The funny thing is I implemented a multicolumn combobox todayIt's about 10 lines of code in total
![]()
The funny thing is I implemented a multicolumn combobox todayIt's about 10 lines of code in total
![]()
Ok, show us the code, and could you add some comments?
I can'tBut I can tell you that all you need to do is replace (using setView()) the default view (which is a QListView) of the combobox with a multicolumn one like QTreeView and optionally reimplement showPopup() to setup the geometry of the popup widget (you will probably want to make it wider than the combobox). Oh... and remember to use a multicolumn model with the widget
![]()
example:
QTableView *tv = new QTableView(this);
tv->setModel( model );
tv->horizontalHeader()->setVisible(false);
tv->verticalHeader()->setVisible(false);
tv->resizeColumnsToContents();
combo->setView(tv);
Last edited by olosie; 11th July 2009 at 10:24.
Bookmarks