The QStyleSheet class is a collection of styles for rich text rendering and a generator of tags.
Questions tagged [qstylesheet]
53 questions
29
votes
5 answers
How do I set a background color for the whole window of a Qt application?
Does anyone know how one would be able to set a background color for the whole window of a Qt application?
So far I am using stylesheets but can only figure out how to assign a background color to a widget such as QGroupBox or QPushButton.…

bryce
- 403
- 1
- 5
- 14
8
votes
6 answers
Change QPushButton Icon on hover and pressed
I'm trying to change the Icon of a QpushButton on hover and pressed, I'm using QtDesigner with stylesheets.
I tried this
QpushButton{
qproperty-icon:url(:/images/start.png);
}
QPushButton:hover
{
…

Zeyad Obaia
- 686
- 1
- 6
- 21
7
votes
2 answers
tick marks disappear on styled QSlider
I'm using Qt 5.3 and trying to style a QSlider. However, when I apply my style-sheet, the tick marks disappear. Does anyone know how to keep the styling without affecting the tick marks?
Here is the style sheet:
QSlider::groove:horizontal
{
…

Nicolas Holthaus
- 7,763
- 4
- 42
- 97
5
votes
2 answers
QSlider increase handle size
I need badly to increase size of handle for my slider, but no css options can do this(styleSheet()).
The default example from Qt docs didn't help me as well.
I have a slider like this:
I wish to increase the height of its handle, as shown on…

Preonix
- 53
- 1
- 1
- 9
4
votes
2 answers
How to make color for checked QRadioButton but looks like standard?
I know many people asked this question. I also searched it here already. One of easiest solutions is with stylesheet:
QRadioButton {
background-color: rgb(252,254,252);
color: black;
}
QRadioButton::indicator {
width: 11px;
height:…

gnase
- 580
- 2
- 10
- 25
4
votes
1 answer
How to obtain entire Qt StyleSheet for QMacStyle
Is it possible to obtain a text file of the entire Qt5 StyleSheet for QMacStyle (or its equivalent QProxyStyle that's apparently used in Qt5)?
I'm hoping to get a list of all the property:value pairs ('background-color', 'border-radius',…

lcikgl
- 759
- 1
- 8
- 20
4
votes
2 answers
QToolButton with icon + text: How to center both?
I am using multiple QToolButtons in a custom QGridLayout widget. The buttons are set to display icon + text based on an assigned default QAction. The only issue is that the content (icon + text) is always left-aligned.
The content (icon + text,…

Philip Allgaier
- 3,505
- 2
- 26
- 53
3
votes
2 answers
Keeping the same selection color in a TableView whether it's active or not
I'm using QTableView class in my GUI and I would like the selected row to have the same color whether the TableView is active or inactive.
I tried to set this CSS stylesheet to achieve this:
QTableView:!active {
selection-background-color:…

Trap
- 218
- 3
- 8
3
votes
1 answer
Obtain inherited stylesheet for a QWidget from parents above it
Is there a simple way to obtain inherited stylesheet for a widget, if stylesheets were set in its parents (some levels above)? stylesheet() would return local value of property only.
In theory, to obtain text of effective stylesheet, I have to walk…

Swift - Friday Pie
- 12,777
- 2
- 19
- 42
3
votes
2 answers
Qt Stylesheets : Unable to use ID Selector
I am learning to use the Qt Stylesheet to add different styles to my application. I looked online and saw the Qt Documentation which said that you can use something called ID Selector that can apply the theme to certain objects. This is how I…

Hung Truong
- 401
- 1
- 3
- 12
2
votes
1 answer
Qt Creating A Left Arrow Styled Push Button
I am creating a Gui application using c++ on Qt Framework.
I have started using Qt a week ago and created a scientific calculator. Now I am creating an application that includes expanding the main window of the application. I have managed to do…

BUY
- 705
- 1
- 11
- 30
2
votes
1 answer
How to customize tab header for QTabBar with a custom witdh=max? (qt style sheet)
I would like a TabBar like that but I don't which parameters of TabBar that I must set? (I want to use only style sheet)
I tried this :
QTabWidget::tab-bar {
background-color: blue;
min-width:2000;
with:2000;
height:50;
}
but…

John Smith
- 771
- 4
- 11
- 25
2
votes
1 answer
Where could I get qt default plastique qss file?
I wanted to copy QComboBox stylesheet but I couldn't find qss file for plastique style.

wondim
- 697
- 15
- 29
2
votes
1 answer
How do I change color of the handle on QSlider
I am unsuccessfully trying to change the color of the handle on a QSlider. How do I change it to a custom color? I have subclassed QSlider so that I can reimplement the paint event and draw my own rectangle on it--now I want to set the color of…

jhowland
- 365
- 1
- 5
- 19
2
votes
1 answer
Set an Icon in QMenu with Stylesheet?
how can i set an Icon for a QAction in QMenu through Stylesheet?
for example:
QMenu* menu = new QMenu();
QAction* action1= new QAction();
QACtion* action2= new QAction();
menu->addAction(action1);
menu->addAction(action2);
now i want to set…

jung
- 557
- 2
- 4
- 16