Results 1 to 2 of 2

Thread: QComboBox drop-down hiding

  1. #1
    Join Date
    Aug 2006
    Posts
    90
    Thanks
    6
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QComboBox drop-down hiding

    Hey guys,

    I am using a QTableWidget that contains QComboBoxes. I want those boxes to look like a regular cell unless they are "selected". Does anyone have any recommendations on how to do this? I attempted to do it with style sheets.

    I am using Qt 4.2.2 (but have access to 4.3.1).
    When I would call setStyleSheet() and pass it something like:
    Qt Code:
    1. pWidget1->setStyleSheet("QComboBox::drop-down:hover { height: 10px }");
    To copy to clipboard, switch view to plain text mode 

    ... the drop down would not appear. I played around with many different attributes for ::drop-down... they all hid the button even when I was not hovering. I take it this is a 4.2.x issue. Has anyone had success on 4.3.x? I am not sure this is the best way to get what I want, so if there is a better way I am all ears.

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QComboBox drop-down hiding

    Lose the comboboxes (I imagine you use setItemWidget() or something like that) and implement a proper item delegate (subclass of QItemDelegate) that will return a combobox as an editor for a cell.

Similar Threads

  1. Drag and drop revisited
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 30th June 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.