Hello PyQt,

I'm wondering why I can't change the text that's displayed in the horizontal
or vertical header of my standard QTableWidget.

- Constructor and simple count specification

self.tw = QtGui.QTableWidget()

self.tw.setColumnCount(5)



- Attempt 1:


> self.tw.setHorizontalHeaderLabels(("a", "b", "c", "d", "e")) # Doesn't
> work, the default "1" ... "5" are still shown

self.tw.setHorizontalHeaderItem(1, QtGui.QTableWidgetItem("b")) # Doesn't
> work, the header label isn't updated to "b"



- Attempt 2:

twi = QtGui.QTableWidgetItem("b")

self.tw.setHorizontalHeaderItem(1, twi)

self.tw.horizontalHeader().setVisible(True) # Nope, this doesn't work either



- Attempt 3:

twi = QtGui.QTableWidgetItem()

self.tw.setHorizontalHeaderItem(1, twi)

self.tw.horizontalHeader().setVisible(True) # Nope, this doesn't work
> either

_twi = self.tw.horizontalHeaderItem(1)

_twi.setText("b") # Nope, doesn't get updated by this either..



What am I doing wrong? How much more combinations of horizontalHeader-stuff
do I have to try in order to do this simple thing?


-- 
Nick Gaens
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to