Results 1 to 3 of 3

Thread: QComboBox: how to change background color of pull down menu

  1. #1
    Join Date
    Jul 2014
    Posts
    23
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QComboBox: how to change background color of pull down menu

    Hi,

    I use QComboBox, I want to change the background color of pull down menu to white (defaut is gray).
    Also do you know how to set tip for each highlight item (some item's wording maybe too long).
    Thanks~

  2. #2
    Join Date
    Feb 2012
    Location
    Warsaw, Poland
    Posts
    37
    Thanks
    3
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: QComboBox: how to change background color of pull down menu


  3. The following user says thank you to west for this useful post:

    jasonhxs (9th March 2015)

  4. #3
    Join Date
    Jul 2014
    Posts
    23
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QComboBox: how to change background color of pull down menu

    Hi,

    Thanks for the suggestion, now I can do it by style sheet setting:
    setStyleSheet("QComboBox_C QAbstractItemView{background:white}");

    BTW, I try to aut0-ajust the width of pull down menu according to inserted item, any idea?

Similar Threads

  1. how to change the QComboBox focus color?
    By josentop in forum Qt Programming
    Replies: 1
    Last Post: 18th December 2011, 17:20
  2. Replies: 0
    Last Post: 7th October 2010, 16:52
  3. How to change QComboBox background with a picture?
    By mulei in forum Qt Programming
    Replies: 3
    Last Post: 24th September 2010, 08:59
  4. background color of menu bar
    By sabeesh in forum Qt Programming
    Replies: 6
    Last Post: 24th July 2007, 13:48
  5. Menu bar background color focus
    By user_mail07 in forum Qt Tools
    Replies: 0
    Last Post: 18th May 2007, 02:25

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.