Results 1 to 5 of 5

Thread: Problem styling QComBox using stylesheet

  1. #1
    Join Date
    Mar 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Post Problem styling QComBox using stylesheet

    Hi,
    I am trying to set the back-ground of combobox which is editable.
    But background seems to be not working for the embedded QLineEdit control.
    Following is my stylesheet implementation and I am using designer and QT 4.3


    QComboBox
    {
    border: 1px solid;
    padding: 2px 25px 2px 10px;
    }

    QComboBox::drop-down
    {
    subcontrol-origin: margin;
    subcontrol-position: top right;
    width: 20px;
    margin-top: 2px;
    border-style: solid;
    border-width: 0px 0px 0px 1px;
    border-color: #999999;
    border-style: solid; /* just a single line */
    borde-radius: 0px; /* same radius as the QComboBox */
    background-color: transparent;
    }

    QComboBox:editable
    {
    color: #02174E;
    border-color: #004D9F;
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 red, stop:1 green);
    }



    I tested the above stylesheet by putting two combox controls on dialog in QT designer. One of the control is editable and enabled while other is editable but disabled.

    Can anybody help me out in setting the back-ground correct in this case?

  2. #2
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Problem styling QComBox using stylesheet

    Access background of the combo box via QListView..

  3. #3
    Join Date
    Mar 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem styling QComBox using stylesheet

    I tried following

    QComboBox:editable > ListView
    {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 red, stop:1 green);
    }


    but not working??

  4. #4
    Join Date
    Mar 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem styling QComBox using stylesheet

    it was typo in my earlier responce code was

    QComboBox:editable > QListView
    {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 red, stop:1 green);
    }



    but not worked?

  5. #5
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Problem styling QComBox using stylesheet

    What's > there?

Similar Threads

  1. Styling QComoBox using CSS Stylesheet
    By bjoernbg in forum Qt Programming
    Replies: 1
    Last Post: 7th October 2010, 00:12
  2. StyleSheet problem
    By fmariusd in forum Qt Programming
    Replies: 0
    Last Post: 22nd February 2010, 17:10
  3. QTableView item's Highlight in QCombox
    By litterflybug in forum Qt Programming
    Replies: 1
    Last Post: 26th August 2009, 15:06
  4. Problem with TabBar und StyleSheet
    By QtNoob in forum Qt Programming
    Replies: 0
    Last Post: 23rd July 2009, 01:06
  5. Stylesheet (css) problem
    By madcama in forum Newbie
    Replies: 1
    Last Post: 4th December 2006, 23:41

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.