Results 1 to 3 of 3

Thread: QCombobox style - list permanently open

  1. #1
    Join Date
    Mar 2012
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QCombobox style - list permanently open

    Hello,

    I need a combox which will display its list permanently. Generally I want the same look as a combobox can have under Motif (first image) and Windows (top most combobox with style CBS_SIMPLE). In short, both consists of a Textfield on top and the list of items below. Both are visible permanently (no arrow to open a view).
    I couldn't find anything on the web or the Qt-docs. Just wanna know did I miss somthing or is this simply not supported?
    If the last, then I would like some advice on how to best proceed. Is there maybe a possiblity to create/influence a QStyle for that (tried to experiment with the style but didn't get the desired result so far) or is it best - as I assume - to write my own widget (consisting of QLineEdit and QListView)?

    Thx,
    bd

  2. #2
    Join Date
    Sep 2009
    Location
    Aachen, Germany
    Posts
    60
    Thanks
    2
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QCombobox style - list permanently open

    Hi,

    That's not possible with a QComboBox. Even if you would change it to have it always show its itemlist, the list would lie on top of the widgets below the QComboBox.
    Why don't you just use a QListWidget and a QLineEdit and use the QListWidget's currenItemChanged Signal to show the current item's text in the QLineEdit? That would be done in about 15min

  3. #3
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QCombobox style - list permanently open

    List in QComboBox is a popup. It lives by different rules which can't be affected.
    IMHO creating custom widget is the way to go.

Similar Threads

  1. Show QComboBox list while editing
    By radix07 in forum Qt Programming
    Replies: 0
    Last Post: 14th October 2011, 16:52
  2. style a list item
    By savar in forum Newbie
    Replies: 3
    Last Post: 18th March 2010, 18:21
  3. Do Qt Style Sheets support List-style-image?
    By daiheitan in forum Qt Programming
    Replies: 6
    Last Post: 12th March 2010, 01:41
  4. Skype style list.
    By bunjee in forum Qt Programming
    Replies: 4
    Last Post: 29th January 2007, 15:49
  5. QComboBox and style
    By Lele in forum Qt Programming
    Replies: 3
    Last Post: 17th July 2006, 16:41

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.