Results 1 to 5 of 5

Thread: Problem with QComboBox

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2006
    Location
    indonesia
    Posts
    55
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 11 Times in 11 Posts

    Default Re: Problem with QComboBox

    Hi wagmare,
    You can use "selection-color" stylesheet method like this:
    Qt Code:
    1. ui->comboBox->setStyleSheet("QComboBox { selection-color: black; color : blue; }");
    To copy to clipboard, switch view to plain text mode 
    This method will change all item at QComboBox, but you can change itemselected color like not selected.
    Example :
    default combobox item color = black
    selected comboxbox item color = black
    not selected comboxbox item color = blue

    I think this method can solve your problem. Or we have missunderstanding about your problem ?
    Thank you for your attention.

    Best regards,

    Toto

  2. #2
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    116
    Thanked 42 Times in 41 Posts

    Default Re: Problem with QComboBox

    Once again thanks for replying myta ..
    ui->comboBox->setStyleSheet("QComboBox { selection-color: black; color : blue; }");

    this you try with QComboBox .. it will change the color of the text when u press the QComboBox and shows the DropDown list ..
    i required the text color change in QComboBox after selection had been done ...

    i tried ur code .. as it is changing only the color of the dropdown selection of the comboBox and not the normal text in the comboBox after selecting ...
    EX:after i selects one item in comboBox .. the item name will be displayed in comboBox .. that name should be shown in red color (for a particular item say index =1)...

    Thanks again .....
    "Behind every great fortune lies a crime" - Balzac

Similar Threads

  1. QComboBox Problem
    By UnforgiveNX in forum Qt Programming
    Replies: 0
    Last Post: 18th November 2010, 16:50
  2. QComboBox problem
    By SteveH in forum Newbie
    Replies: 2
    Last Post: 2nd March 2009, 22:20
  3. QComboBox problem
    By ^NyAw^ in forum Qt Programming
    Replies: 4
    Last Post: 31st March 2008, 12:43
  4. Problem while using QComboBox
    By merry in forum Qt Programming
    Replies: 6
    Last Post: 20th December 2007, 11:22
  5. Problem with QComboBox
    By jogeshwarakundi in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 8th December 2007, 14:21

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
  •  
Qt is a trademark of The Qt Company.