[Tutor] pyqt4 set horizontal header item - extra info
eryksun
eryksun at gmail.com
Sun Mar 31 13:43:24 CEST 2013
On Sun, Mar 31, 2013 at 4:23 AM, Alan Gauld <alan.gauld at btinternet.com> 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 instantiating a TableWidgetItem class?
> But you will likely get better help on Qt topics by asking on a Qt specific
> forum rather than a Python beginners list like this.
> There are a few Qt users here but most are not.
You can use setHorizontalHeaderItem(0, QTableWidgetItem('col 0'), and
so on. It may be simpler to use setHorizontalHeaderLabels(['col 0',
'col 1', 'etc']).
More information about the Tutor
mailing list