Results 1 to 7 of 7

Thread: Style Sheet color of QComboBox

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Style Sheet color of QComboBox

    Run your application with -style Plastique parameters and see if the behaviour persists.

  2. #2
    Join Date
    Oct 2006
    Location
    Hawaii
    Posts
    130
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    48
    Thanked 4 Times in 4 Posts

    Default Re: Style Sheet color of QComboBox

    Ok, Heres something interesting. I ran it in all styles including plastique to see what would happen, and I got the exact same results as I described with the windows XP style, except in the CDE style. Heres what happened:

    -When the form is untouched in CDE and classic windows style, the comboboxes are raised, but they are white. When the test slot is activated, the ui.vendor_state combobox becomes grey, and the ui.vendor_zip line edit becomes yellow.

    -In the classic windows style, the same thing happens as in the CDE, except instead of the whole combobox turning grey on activation of the slot, only the tiny drop arrow on the right hand side turns from white to grey.

    I notice that the plastique or cleanlooks style, the comboboxes are a shiny gray color when you are not in the process of selecting an item from them. It seems like this can't be changed.

    In the windows XP style, the comboboxes are text with a white background but still won't take the style. They look like they could be changed, but maybe they somehow inherit the same traits as plastique/cleanlooks.

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

    Default Re: Style Sheet color of QComboBox

    I suggest you upgrade your Qt installation. You might be suffering from some kind of bug. Stylesheets are a quite new technology in Qt and still contain many bugs. The sheet seems to work fine on my 4.3-based installation.

  4. The following user says thank you to wysota for this useful post:

    tpf80 (25th June 2007)

  5. #4
    Join Date
    Oct 2006
    Location
    Hawaii
    Posts
    130
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    48
    Thanked 4 Times in 4 Posts

    Default Re: Style Sheet color of QComboBox

    Yes that fixed it, after upgrading to Qt 4.3 and re-compiling my program, the QComboBox takes the style like expected.

Similar Threads

  1. Qt 4.3 Style sheet, new features
    By Angelo Moriconi in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2007, 15:22
  2. Qt Designer Style Sheet Resources
    By bjoernbg in forum Newbie
    Replies: 1
    Last Post: 24th January 2007, 07:12
  3. How to use style sheet
    By safknw in forum Qt Programming
    Replies: 1
    Last Post: 20th November 2006, 13:05
  4. 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
  •  
Qt is a trademark of The Qt Company.