Questions tagged [qstylesheet]

The QStyleSheet class is a collection of styles for rich text rendering and a generator of tags.

Documentation can be found here (Qt4) and here (Qt5).

53 questions
0
votes
1 answer

QPushButton background color dynamically

I have a QPushButton on which I would like to set the background color. I can use stylesheets for this: m_iconButton->setStyleSheet("QPushButton {" "background-color: red " "}"); However I…
Frank
  • 2,446
  • 7
  • 33
  • 67
0
votes
1 answer

How to customize the QTextEdit boundaries?

I'm very new to the designer mode of Qt. I want QTextEdit to have a look exactly as shown in this . "High Score" should be part of the boundary. How is it possible to customize the qtextedit like this? Is it through QStylesheet I have to do that or…
the_naive
  • 2,936
  • 6
  • 39
  • 68
0
votes
1 answer

How to load a stylesheet while using QQmlApplicationEngine

I am currently trying to load a stylesheet for a simple Qt5 application. Therefore I use the following code: QApplication app(argc, argv); QFile styleFile("./css/style.qss"); styleFile.open(QFile::ReadOnly); QString stylesheet =…
Phidelux
  • 2,043
  • 1
  • 32
  • 50
0
votes
2 answers

QComboBox become ugly when changing main windows background

Before changing: After changing parent widget styleSheet property to this: background-color: rgb(5, 34, 78); I see this: QComboBox become really different. What happens? How to use regular QComboBox on dark background? I am using Qt 5.5 without…
k06a
  • 17,755
  • 10
  • 70
  • 110
0
votes
1 answer

QTreeWidget Stylesheet Color for Childs

System: Linux Mint, QT Creator from Repo -> QT Version 5.2, C++) I've created a Customwidget wich Im using inside a QTreeView OwnItem *OI = new OwnItem; QTreeWidgetItem *itemN = new…
hypnomaki
  • 593
  • 9
  • 22
0
votes
1 answer

Difference between setStyleSheet of QWidget and QApplication

In my main I try to set the stylesheet for my mainwidget (Subclass of QWidget). But unfortunately it does not apply. With qApp it works. Whats the difference? In the docs I cant find any.
ManuelSchneid3r
  • 15,850
  • 12
  • 65
  • 103
0
votes
1 answer

QLabel add 'border' around text

Is it possible to add a slight 'border' atop and below the text displayed in a QLabel? The border should not be at the edge of the QLabel. Instead it should have a padding of something like 10px to the displayed text. The size of the border would be…
Niklas
  • 23,674
  • 33
  • 131
  • 170
-1
votes
1 answer

How to change drop-down background color on qcombobox hover?

I need to change the drop-down button background of the QComboBox when the mouse hover on QComboBox. I dont get how to do that? If I wrote QComboBox::drop-down:hover it would be wrong because it is selector to hower ower drop-down button not ower…
AeroSun
  • 2,401
  • 2
  • 23
  • 46
1 2 3
4