Results 1 to 2 of 2

Thread: Stylesheet on QComboBox.

  1. #1
    Join Date
    Dec 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Stylesheet on QComboBox.

    Dear group,

    I'm using Qt for an open source project of mine (dlRaw).
    Wonderful library, really.

    I'm now stuck on something where the manuals and google are not able to help me.

    I want to style a QComboBox and following small stylesheet snippet is giving me trouble :

    QComboBox {
    background-color : blue;
    color : red;
    }

    I would assume that this puts the background of the combobox in blue and the 'arrow' and 'text' in red. On my 4.5.2 Qt (in Ubuntu 9.10) this is effectively what happens.

    On my newer Ubuntu, featuring 4.7.0 the 'text' doesn't change color.
    So I downloaded 4.7.1 (one never knows it is a bug ..) and also there the 'text' does not change color.

    Has there been changes between 4.5.2 and now that require me to style the QComboBox in a different way ? I seem to be able to change nearly every aspect of the combobox, except for that text ... (which is of course in an impossible colour for my current theme ....

    All help is much appreciated.

    Jos

  2. #2
    Join Date
    Dec 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Stylesheet on QComboBox.

    Dear group,

    Some additional information that sheds some different light on the subject.

    I now 'downgraded' my other box , the one with the problem , to Qt 4.5.2 and I still have the same problem. Then I noticed that my original box - the one it works upon - has Xfce running as desktop, while my new box runs Gnome.

    Now, if I turn the desktop to Xfce, it works as expected. If I run it in Gnome, it doesn't !

    I'm now completely stuck ... It seems that the desktop is somehow taking over control of some of the elements ? Or what ? Can this be changed ?

    Thanks for all help of hints,

    Jos

    P.S. I doubt if this still is a "newbie" question. So administrator, you might want to move the thread.


    Added after 14 minutes:


    Dear group,

    My latest post worked quite as a therapy

    The answer to the question was somehow in the post : it's of course the "default style" that makes the difference. Running my application with -style plastique or -style motif ... makes the combobox respond correctly to the stylesheet.

    I leave this one to the experts, but it appears to me that this can be classified as a bug that reveals itselfs under gtk-style.

    Best regards,

    Jos
    Last edited by jos; 5th December 2010 at 10:08.

Similar Threads

  1. stylesheet
    By BalaQT in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2010, 07:45
  2. Qt Stylesheet
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 22nd January 2009, 14:48
  3. How to do this with StyleSheet
    By yxmaomao in forum Qt Programming
    Replies: 5
    Last Post: 30th May 2008, 08:54
  4. stylesheet
    By phillip_Qt in forum Qt Programming
    Replies: 11
    Last Post: 27th April 2008, 19:11
  5. how to set stylesheet for two QWidget
    By phillip_Qt in forum Qt Programming
    Replies: 3
    Last Post: 10th April 2008, 14:22

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.