Re: [Tutor] pyqt4 set horizontal header item - solved

2013-04-01 Thread Phil
On 01/04/13 19:47, eryksun wrote: On Sun, Mar 31, 2013 at 8:13 PM, Phil wrote: I have the answer (provided by a member of another list) and I was correct, it was something basic. from PyQt4 import QtGui QtGui.QTable etc Sorry, I assumed you were familiar with the package layout. http://pyq

Re: [Tutor] pyqt4 set horizontal header item - solved

2013-04-01 Thread eryksun
On Sun, Mar 31, 2013 at 8:13 PM, Phil wrote: > > I have the answer (provided by a member of another list) and I was correct, > it was something basic. > > from PyQt4 import QtGui > QtGui.QTable etc Sorry, I assumed you were familiar with the package layout. http://pyqt.sourceforge.net/Docs/PyQt4

Re: [Tutor] pyqt4 set horizontal header item - solved

2013-03-31 Thread Phil
On 31/03/13 21:43, eryksun wrote: You can use setHorizontalHeaderItem(0, QTableWidgetItem('col 0'), and so on. It may be simpler to use setHorizontalHeaderLabels(['col 0', 'col 1', 'etc']). I have the answer (provided by a member of another list) and I was correct, it was something basic.

Re: [Tutor] pyqt4 set horizontal header item - extra info

2013-03-31 Thread Phil
On 31/03/13 21:43, eryksun wrote: You can use setHorizontalHeaderItem(0, QTableWidgetItem('col 0'), and so on. It may be simpler to use setHorizontalHeaderLabels(['col 0', 'col 1', 'etc']). Thanks Eryksun, I had already tried your suggestion last night and this is the result; "global name

Re: [Tutor] pyqt4 set horizontal header item - extra info

2013-03-31 Thread eryksun
On Sun, Mar 31, 2013 at 4:23 AM, Alan Gauld wrote: > On 31/03/13 08:30, Phil wrote: > >> self.tableWidget.setHorizontalHeaderItem (1, QTableWidgetItem *item) >> >> I have done this many years ago in C++ but I don't quite see how to get >> a QTableWidgetItem in Python. > > Presumably by instantiati

Re: [Tutor] pyqt4 set horizontal header item - extra info

2013-03-31 Thread Alan Gauld
On 31/03/13 08:30, Phil wrote: self.tableWidget.setHorizontalHeaderItem (1, QTableWidgetItem *item) I have done this many years ago in C++ but I don't quite see how to get a QTableWidgetItem in Python. Presumably by instantiating a TableWidgetItem class? But you will likely get better help o

Re: [Tutor] pyqt4 set horizontal header item - extra info

2013-03-31 Thread Phil
On 31/03/13 14:29, Phil wrote: Thank you for reading this. I want to set a table widget header based on its cell contents. The following sets all of the headers; self.tableWidget.setHorizontalHeaderLabels(["One", "Two", "Etc"]) However, self.setHorizontalHeaderItem ( 1, ["test"]) and self.set

[Tutor] pyqt4 set horizontal header item

2013-03-31 Thread Phil
Thank you for reading this. I want to set a table widget header based on its cell contents. The following sets all of the headers; self.tableWidget.setHorizontalHeaderLabels(["One", "Two", "Etc"]) However, self.setHorizontalHeaderItem ( 1, ["test"]) and self.setHorizontalHeaderItem ( 1, "test