3 Attachment(s)
Combo with cascading list
Hi,
I am developing a control where combo contains QColumnView as popup. I have attached the png of Preview(ComboBox.png).
I have used QStandartItemModel to have multilevel item list and added into the QColumnView using setModel(). Using setView() of QComboBox i am inserting the QColumnView instance. but while poping down it display the normal popup which contain the normal list box instead of column view. Can any one tell me how can i resolve this.
I have attached the source code. Can anyone please update the code.
Thank you.
Re: Combo with cascading list
set minimum size for QColumnView, e.g.
Code:
m_ColumnView->setMinimumSize(400, 400);
Re: Combo with cascading list
or you can make more flexible
Code:
...
m_ComboBox->setView(m_ColumnView);
m_ComboBox
->view
()->setCornerWidget
(new QSizeGrip(m_ColumnView
));
m_ComboBox->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
...
Re: Combo with cascading list
Thank you for the reply this works fine. But when i select the child item of first item, then it creates 3rd column in QColumnView. Is there any way to avoid third column. Because i need only two column to be created.
Or is there any other way to create these control.