Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QComboBox and QAbstractSpinBox custom stylesheet affects arrow buttons
Forum Updated to NodeBB v4.3 + New Features

QComboBox and QAbstractSpinBox custom stylesheet affects arrow buttons

Scheduled Pinned Locked Moved Unsolved General and Desktop
gradientqcomboboxqabstractspinbostylesheet
1 Posts 1 Posters 595 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sadeq
    wrote on last edited by sadeq
    #1

    Hello
    I want to remove the gradient from these widgets to give them a "flat look" using custom stylesheet but it messes up the arrow buttons shape.
    first if want to do this to a QPushButton I have to change the color and the border style also, if I edit the color only the gradient effect will still appear

                      QPushButton{
                         border-style : solid;
                         border-radius : 3px;
                         border-width : 0.8px;
                         border-color : white;
                         background-color:white;
                         color : black;
                         }
    

    original look
    original look , you can see the gradient and the popped up feel.
    now, if I apply the same css to a QComboBox and QAbstractSpinBox the shape will look like this.
    after css
    after css
    intended look except for the color
    intended look except for the color

    I searched online for solutions and I found this in qtcentre forms and found this

    pushButton->setStyleSheet("background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 white, stop: 1 white);");

    if i apply this to the combobox it will appear completely black on "fusion" style

    is there a way to give a flat look to these widgets without messing up the look of the arrow buttons ?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved