[Tutor] pyqt4 set horizontal header item - extra info

Phil phil_lor at bigpond.com
Mon Apr 1 02:01:47 CEST 2013


On 31/03/13 21:43, eryksun wrote:
<cut>

>
> 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 'QTableWidgetItem' is not defined"

You are correct, I can easily set all of the labels at once but only one 
label needs to be modified according to it's cell contents. I'm sure I'm 
missing something very basic.

-- 
Regards,
Phil


More information about the Tutor mailing list