[PyQt] Size problem

Alexandre Badez alexandre.badez at gmail.com
Fri Feb 22 10:04:14 GMT 2008


Hy,

I'm displaying some combo box in a table widget and it work quiet well.
My problem is that I can't get that the column's size of the table is enough
to see the max size of the combo.

Here is a little sample:

from PyQt4 import QtGui
import sys

app = QtGui.QApplication(sys.argv)

table = QtGui.QTableWidget()
table.setRowCount(2)
table.setColumnCount(2)
table_header = table.horizontalHeader()
table_header.setResizeMode(table_header.Interactive)

combo = QtGui.QComboBox()
combo.addItem("blop")
combo.addItem("a very long word or sentence I want to be readeable in my
table")
combo.setSizeAdjustPolicy(combo.AdjustToContents)

table.setCellWidget(0, 0, combo)

table.show()

sys.exit(app.exec_())


Do you know how should I do it ?

-- 
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20080222/e064e032/attachment.html


More information about the PyQt mailing list