Questions tagged [qtstylesheets]

For questions relating to Qt Style Sheets, which allow declarative customization of Qt objects.

Qt Style Sheets enable customization of the appearance of widgets, in addition to what is possible by subclassing QStyle. The concepts, terminology, and syntax of Qt Style Sheets are heavily inspired by HTML Cascading Style Sheets (CSS) but adapted to the world of widgets, and supporting features considered as valid for the CSS 2.1 specification only.

769 questions
0
votes
0 answers

css properties in a pushbutton are not overridden in :checked ? (Qt qss)

I use this in Qt 4. The code for both: QPushButton#groupBoxTitleExpand { min-height: 25px; max-height: 25px; border-style: solid; border-width: 0px 17px 0px 3px; border-image: url(:/image.png) 0 17 0 3 fill repeat; }…
Darkgaze
  • 2,280
  • 6
  • 36
  • 59
0
votes
1 answer

QTabWidget with tabs both at the top and to the right.

I have a QTabWidget with two tabs. I want one to be on the east side and the other one at the top. I've tried these style sheets, but so far I couldn't get it…
SamuelNLP
  • 4,038
  • 9
  • 59
  • 102
0
votes
1 answer

Why styling QT widgets makes them overstep size values?

This is something i´ve been struggling with since i started using stylesheets on QT. I have this style: QPushButton#btnNewCamera { border-radius: 5px; min-width: 20px; min-height: 20px; background-position: center; …
Darkgaze
  • 2,280
  • 6
  • 36
  • 59
0
votes
1 answer

Qt compilation and stylesheet

Each time I compile my Qt project after modifying my qss stylesheet file, the modifications aren't taken into account, unless I rebuild everything. Any idea on a workaround for this, so that I don't have to wait 5 minutes each time I change my qss…
Yosko
  • 329
  • 1
  • 4
  • 15
0
votes
2 answers

How to style QSpliter handle and scrollbar like this?

Screep-shot link: http://qt-apps.org/CONTENT/content-pre1/119860-1.png I would like to customize the look of scrollbar handle and QSplitter handle like the screen shot link above. I know it can be done from stylesheet. However I have no idea how to…
JAY
  • 3
  • 1
  • 4
0
votes
1 answer

Style Sheet to layout and SeekSlider?

I need some help here, I have two questions regarding Qt's style sheet customization I know that I can set background image to a Widget but can I set a background image to a layout using Qt Style Sheets? And can I customize the SeekSlider with Style…
Clepto
  • 685
  • 1
  • 6
  • 7
-1
votes
0 answers

Qt, how to animate multiple style properties of a widget

My program requires buttons and other widgets to be animatable, i.e. that after some event occurs, such as hovering over a button, it changes its style using a transition, basically what you could in css do with this code: .myButton { width:…
-1
votes
0 answers

Stylesheet(QSS) not work when I use qApp.setStyleSheet(qss)

// MyDialog.h // #pragma once #include #include #include class MyDialog : public QProgressDialog { Q_OBJECT public: explicit MyDialog(const QString &text, QWidget *parent = nullptr) :…
Paul
  • 1
  • 2
-1
votes
1 answer

PySide6 QCalendarWidget Qss style problem with month names

i have a weird problem with qss styling an QCalendarWidget The months names get overlapped by the menu indicator. Anyone have an idea why?
-1
votes
1 answer

Set the right-arrow icon of a specific QMenu in Qt

I am trying to change the icon of a QMenu's right arrow. The following QSS rule works QMenu::right-arrow { image: url(icons:icon_name.svg); } However, it changes the right arrows of all QMenus. I want to select only QMenus that have some…
Borislav-K
  • 11
  • 2
-1
votes
1 answer

PyQt5 QPushButton setSyleSheet does not change button color when pressed

After studying various examples in this forum, I tried to change the color of a button when pressed. The button is normally blue, and when it is pressed I want it to turn red. The following code does display a blue button with white text, but it…
ear1
  • 45
  • 5
-1
votes
1 answer

progressbar is incorrect displayed

I have the progressbar and i used Qt StyleSheet for rounding his corners. the problem is that when the indicator has not reached the 20% mark, it is not rounded on one side. I attached screenshots to make it clearer. I guess it has to do with my Qt…
D3-one 6
  • 45
  • 5
-1
votes
2 answers

pyqt: why the loaded qss file do not work

I am loading qss file in my project. And I find it do not work. My qss file is: QMainWindow { font-size: 20px; background: rgb(255, 0, 0); } My code is: from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import…
Qiang Zhang
  • 820
  • 8
  • 32
-1
votes
1 answer

Different hover styling on different labels

self.scrollArea.setStyleSheet("background-color: rgba(255, 0, 0, 0); border-style:none;\n" "}\n" "QLabel#label2 { \n" " background-color: rgba(0, 0, 0, 120); color: white; text: center; border-style:solid; border- width:…
thedoctor
  • 50
  • 7
-1
votes
1 answer

Making a clicked QListWidgetItem borderless

I have a QListWidget subclass widget deal with mouse events, as the picture below: Its items will show text when cursor hover on the icon, and the hover background is transparent. Selection will be automatically cleared after click, but I'm still…
closer_ex
  • 23
  • 8
1 2 3
51
52