Results 1 to 4 of 4

Thread: Combo with cascading list

  1. #1
    Join Date
    Aug 2008
    Posts
    134
    Thanks
    10
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default 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.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Combo with cascading list

    set minimum size for QColumnView, e.g.
    Qt Code:
    1. m_ColumnView->setMinimumSize(400, 400);
    To copy to clipboard, switch view to plain text mode 
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Combo with cascading list

    or you can make more flexible
    Qt Code:
    1. ...
    2. m_ComboBox->setView(m_ColumnView);
    3. m_ComboBox->view()->setCornerWidget(new QSizeGrip(m_ColumnView));
    4. m_ComboBox->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    5. ...
    To copy to clipboard, switch view to plain text mode 
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  4. The following user says thank you to spirit for this useful post:

    navi1084 (17th February 2010)

  5. #4
    Join Date
    Aug 2008
    Posts
    134
    Thanks
    10
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default 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.

Similar Threads

  1. Combo with multi-line underlying list?
    By Avrohom in forum Qt Programming
    Replies: 3
    Last Post: 28th August 2009, 00:32
  2. problem cascading in MDI
    By eric_vi in forum Qt Programming
    Replies: 0
    Last Post: 12th August 2009, 17:02
  3. DropDown combo box
    By Tavit in forum Qt Programming
    Replies: 3
    Last Post: 3rd May 2008, 08:40
  4. combo box in Header of QTableWidget
    By sar_van81 in forum Qt Programming
    Replies: 1
    Last Post: 6th February 2008, 16:58
  5. Multi-selection Combo Box
    By EricF in forum Qt Programming
    Replies: 7
    Last Post: 7th November 2007, 07:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.