PDA

View Full Version : QListWidget and QListWidgetItem



Noxxik
25th February 2009, 20:38
Hi I have QListWidget and I want to set QListWidgetItem in 2 columns. Can someone help me, how I set it? thanks

Lykurg
25th February 2009, 20:45
don't get you right:
- if you mean that you want to add the same item twice see the documentation:
Warning: A QListWidgetItem can only be added to a QListWidget once. Adding the same QListWidgetItem multiple times to a QListWidget will result in undefined behavior.
- if you really want two columns you should use QTableWidget.

spirit
25th February 2009, 20:47
QListWidget has only one column. why don't you use QTableWidget insted of QListWidget or use your own model with own view?

Noxxik
25th February 2009, 22:36
QTableWidget. this is what I find thx ;)

drhex
26th February 2009, 07:59
QTreeWidget can also have multiple columns. I prefer it over QTableWidget because there is less vertical space wasted between the entries.

yunxiaodong
3rd August 2011, 09:59
I want to use QListWidget in two or more columns. why not use QTreeWidget or QTableWidget,because they have no IconMode. how should I do? my email : yunxiaodong@163.com