[PyQt] Table Widget Problem v4.4.3

David Boddie dboddie at trolltech.com
Mon Aug 25 19:01:37 BST 2008


On Mon Aug 25 15:42:25 BST 2008, Carr, David wrote:

> I move to version 4.4.3 and now cannot get QLabel to display in the table
> widget.  Other Widgets such as QComboBox and QTextEdit work fine, QLabel no
> longer displays and was working fine in previous versions. Any thoughts or
> suggestions would be helpful.
>
> Example code
> itm2 = QtGui.QLabel()
> itm2.setAlignment(QtCore.Qt.AlignCenter)
> itm2.setText('Test')
> self.tableWidgetQTSetMap.setCellWidget(0,0,itm2)

This problem seems to have occurred with Qt 4.4.0 and was apparently fixed in
Qt 4.4.1:

http://trolltech.com/developer/task-tracker/index_html?id=210490&method=entry

My experiments suggest that this was still broken in some cases in Qt 4.4.1,
but that it is now fixed in current snapshots of Qt 4.4.2.

One workaround is to put the label in a container widget (using a layout) and
put that in a table cell instead.

David


More information about the PyQt mailing list