Results 1 to 5 of 5

Thread: How to make QComboBox as multiselect in Qt

  1. #1
    Join Date
    Jul 2016
    Location
    Nagpur
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Question How to make QComboBox as multiselect in Qt

    Hello

    Please tell me how to select multiple items in combo box.


    Regards
    pranjali nagpure

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to make QComboBox as multiselect in Qt

    From the QComboBox documentation:

    Note that you cannot alter the SelectionMode of the view(), e.g., by using setSelectionMode().
    QComboBox is single selection only. Think about it - if you could make it multiple selection, how would you display the result once the drop-down is closed?

    I suggest you substitute QListWidget or QListView in your GUI if you want multiple / extended selection mode.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    503
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to make QComboBox as multiselect in Qt

    Hi, Qwt has QxtCheckComboBox for this.

    Ginsengelf

  4. #4
    Join Date
    Sep 2016
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: How to make QComboBox as multiselect in Qt

    ok. I was facing the same issue.. thanks for post

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to make QComboBox as multiselect in Qt

    @Ginsengelf means "Qxt", not "Qwt". In any case, it is based on Qt4, is no longer maintained, and as the Qxt website itself says:

    Qxt will likely not work with newer Qt versions due to usage of internal api. We recommend that you pick out the parts you want instead of using the entire libqxt.
    So, depending on how much of QxtCheckComboBox is based on undocumented internals of Qt, and how much those internals have changed between Qt4 and Qt5, you may not be able to use it at all.

    The biggest change from Qt4 -> Qt5 is the removal of all OS-dependent GUI code from widget implementations into window-system-specific plugins. Since the combo box is a GUI widget, the Qt4 internal implementation is probably greatly different.

    You might have better luck finding something in KDE. Check out the qinclude.org site for all sorts of Qt libraries.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 3
    Last Post: 19th August 2014, 23:13
  2. how to make translatable items in QComboBox?
    By zgulser in forum Qt Programming
    Replies: 2
    Last Post: 11th August 2012, 17:12
  3. Replies: 1
    Last Post: 15th December 2010, 14:20
  4. Replies: 2
    Last Post: 18th October 2010, 15:33
  5. Make the QComboBox popup translucent or transparent ?
    By charlse in forum Qt Programming
    Replies: 5
    Last Post: 18th August 2008, 17:18

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.