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
2
votes
0 answers

Changing the foreground color of sub-elements of selected rows in Qt5.4

I would like to change the foreground color of cell widgets in a QTableWidget. The hierarchy is the following: QTableWidget > QTableWidgetItem[] >> QLabel >> QLineEdit >> QLineEdit >> QLineEdit >> QLineEdit That is, five columns and N rows in a…
casparjespersen
  • 3,460
  • 5
  • 38
  • 63
1
vote
2 answers

Cursor still appears in LineEdit although it is not focused any more

I need to combine a LineEdit and a Button together into such an element and I want the lineEdit works as usual. But when I click on the lineEdit, the cursor does not appear, only when I click 3 times, then cursor appears but does not blink. After…
trangan
  • 341
  • 8
  • 22
1
vote
1 answer

Qt QFrame StyleSheet not working in MainWindow

I am struggling with a basic StyleSheet question. I am trying to apply a stylesheet to a QFrame within a MainWindow, and for some reason, the stylesheet is being ignored. This seems related to Qt Stylesheet for custom widget and Enable own widget…
1
vote
0 answers

How do I display the full text on the Qtabbar label?

I want to display like picA but now it's like picB , here is my stylesheet QTabBar:tab { background-color: #2D2D2D; color: #969696; font: 9pt "Courier New"; padding: 15px; } QTabBar:tab:selected { background-color: #1E1E1E; …
Relax ZeroC
  • 651
  • 1
  • 12
  • 27
1
vote
0 answers

Qt: find widget "Could not parse stylesheet of object"?

I am getting warnings: "Could not parse stylesheet of object "; actually, several warnings, all with the same address I inherited a project with a gazillion widgets and with the stylesheets moved to .cpp files -- how can I find what QObject…
TheBick
  • 341
  • 1
  • 5
  • 12
1
vote
1 answer

How to get QWidget background-color after set a QStyleSheet

I have my desktop QApplication (Qt 5.9) on which I successfully set a style using a stylesheet. At runtime every QWidget look correctly styled as intended. What I need to know is the background-color of a specific styled widget, let's say a…
Sneezeface
  • 23
  • 1
  • 5
1
vote
1 answer

How to set only QTabWidget background color stylesheet

I have a Qt application that, among many other widget types, uses a QTabWidget. I'm having difficulty styling the background color for this object. I've tried some of the following lines, which I found from other forum posts, in my stylesheet with…
Stanton
  • 904
  • 10
  • 25
1
vote
2 answers

QTreeView disable highlighting on a row hover

I don't want rows to be highlighted on mouse hover. How to disable this highlighting? Either remove highlighting at all or change it's color: both solutions are fine.
Nikolai Shalakin
  • 1,349
  • 2
  • 13
  • 25
1
vote
1 answer

QMenuBar not using native style? c++ , QTDesigner. Ui

I have a small Ui. It has a MainWindow. and at top is the QMenuBar. When I run the program ( which has no error messages ) everything functions ok. However, the subitems for the Menu do not have any style when hovered or pressed. They are…
joacampb
  • 177
  • 1
  • 18
1
vote
1 answer

Rounding QSpinBox Background Color Corners

I'm developing a GUI in Qt 4.8 ( C++ being the base language ), and I have trouble stylizing a QSpinBox. I'd like the widget to have a nice rounded border ( I've disabled the up and down buttons via Qt Creator ) using Qt Style Sheets and I manage to…
Cyril C.
  • 112
  • 8
1
vote
1 answer

QToolButton accepts Hover in disabled state?

I have that icon: This is QToolButton's inheritor without overrided paint event, actually I'm working right in the Qt Designer right now. It has some overloaded styles: MyToolButton { border-style: none; padding-right: 14px; border-radius:…
Vladimir Tsyshnatiy
  • 989
  • 1
  • 10
  • 20
1
vote
1 answer

Qt stylesheet for all QProgressBars programmatically (C++)

Having trouble understanding how to programmatically set a stylesheet to be applied on several (or even all) widgets in Qt Creator 4.1 (Qt 5.7) with C++. For example, say I have 3 progress bar widgets; I have explicitly set each with the same…
user6167676
1
vote
0 answers

Increase height of dropped separator in QTreeView

I need to increase height of black separator, when I try to drop item between other two. Simple code: MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); …
LyndaOlexandr
  • 311
  • 2
  • 10
1
vote
0 answers

how to set background color of qlineedit when it's a widget in qgraphics scene

Using PyQt, I'm trying to use a stylesheet to set the background color of a QLineEdit that I've added to a QGraphicsScene. Problem is the background color is the only property I can't seem to change. For example: import sys from PyQt5.QtWidgets…
1
vote
1 answer

Qt5 custom context menu ignoring style sheet

I have a two editor classes, say BaseEditor and AdvancedEditor. BaseEditor inherits from QPlaintTextEdit and its standard context menu follows my style sheet properly. My AdvancedEditor now inherits from BaseEditor and reimplements the method void…
Philip Allgaier
  • 3,505
  • 2
  • 26
  • 53