Results 1 to 2 of 2

Thread: QComboBox pop-up styling

  1. #1
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default QComboBox pop-up styling

    Hello. I'd like to know what is the way to customize QComboBox pop-up via QSS. Namely I want to remove the corners of the pop-up area, because in my case it is rounded.

    This is the code I tried:
    Qt Code:
    1. QWidget#myParentWidget QComboBox QAbstractItemView
    2. {
    3. border-radius: 15px;
    4. background-color: red;
    5. }
    To copy to clipboard, switch view to plain text mode 

    It produces the result like this:
    qcombobox.png
    Although pop-up is rounded and filled with the proper background color there is still something in the background that I can't remove.

    Also I'd like to know if it is possible to apply QSS style to the items of the pop-up area. The following code doesn't work:
    Qt Code:
    1. QWidget#myParentWidget QComboBox QAbstractItemView::item
    2. {
    3. border-color: green;
    4. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    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 pop-up styling

    I don't think you can do either.
    I guess you know this page.

Similar Threads

  1. Styling QComboBox and QSpinBox
    By pafcu in forum Qt Programming
    Replies: 0
    Last Post: 18th December 2010, 15:42
  2. Styling QComboBox
    By martinn in forum Qt Programming
    Replies: 1
    Last Post: 2nd March 2010, 21:55
  3. Styling each item in a QComboBox
    By rishid in forum Qt Programming
    Replies: 2
    Last Post: 23rd February 2008, 10:10
  4. QComboBox styling
    By Oleg in forum Qt Programming
    Replies: 3
    Last Post: 26th November 2007, 00:48
  5. Styling a QComboBox
    By Enygma in forum Qt Programming
    Replies: 6
    Last Post: 23rd August 2007, 11:22

Tags for this Thread

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.