[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] Size problem
From:       "Alexandre Badez" <alexandre.badez () gmail ! com>
Date:       2008-02-22 10:04:14
Message-ID: 20f595e90802220204m100695aakf0efd642b51a5bd0 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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

[Attachment #5 (text/html)]

Hy,<br><br>I&#39;m displaying some combo box in a table widget and it work quiet \
well.<br>My problem is that I can&#39;t get that the column&#39;s size of the table \
is enough to see the max size of the combo.<br><br>Here is a little sample:<br> \
<br>from PyQt4 import QtGui<br>import sys<br><br>app = \
QtGui.QApplication(sys.argv)<br><br>table = \
QtGui.QTableWidget()<br>table.setRowCount(2)<br>table.setColumnCount(2)<br>table_header \
= table.horizontalHeader()<br>table_header.setResizeMode(table_header.Interactive)<br>
 <br>combo = QtGui.QComboBox()<br>combo.addItem(&quot;blop&quot;)<br>combo.addItem(&quot;a \
very long word or sentence I want to be readeable in my \
table&quot;)<br>combo.setSizeAdjustPolicy(combo.AdjustToContents)<br><br>table.setCellWidget(0, \
0, combo)<br> <br>table.show()<br><br>sys.exit(app.exec_())<br><br clear="all"><br>Do \
you know how should I do it ?<br><br>-- <br>Alex<br>



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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic