» Using QApplication::setStyleSheet to override QSS attributes set in Qt
Using QApplication::setStyleSheet to override QSS attributes set in Qt
|September 29, 2014
Posted by forumadmin
I created a button in
Qt and gave it the
background-color: gray;, while my external styleheet has set the
QSS attribute of the same button to
background-color: blue;. When I run the application the button is gray, even though the style sheet is applied after the
QWidget::show() is called and just before
QApplication::exec(), as shown below:
app.setStyleSheet("..."); // contents of external styleheet
Is it possible to have
QApplication::setStyleSheet() override the
QSS attributes assigned to a Widget in
More Related Questions
- Stylesheets, widgets hidden and sizes in Qt There is a big problem with styleheets.
If you set the sizes through the style sheet by setting max and min values the same (fixed size) or whatever, and then you try to fetch them using […]
- PySide using Style Sheets to change QtoolBox I'm Wondering if somebody knows a better reference than the QT one for style sheets.
I try to change the background of the content from a QToolBox but background-color only changes the […]
- Restore qt integration after removing KDE Restore GTK integration after removing KDE; this shows how to remove the kde-theme for gtk, and now I want to do the same for qt-applications. I have tried qt4-qtconfig, and it does not […]
- Qt Creator needs a compiler set up to build. Configure a compiler in kit options I just installed Qt 5.2 package on ubuntu. I simply created a Qt widget application, and when I tried to build it, I got the following message:
Qt Creator needs a compiler set up to […]
- How to render a a complex widget inside a tree view item in QT? I have the following problem with QT model/view framework. I want to render a widget inside a table view item.
First my thought was to use
void QAbstractItemView::setIndexWidget( const […]
- Loading Qt GUI Widgets on application startup is significantly slower on Windows compared to Linux We have a quite GUI heavy application with several nested tabwidget structures with a lot of widgets (in total approx. 10k) inside. During application start all of these get initialized, […]
- Qt signals missing in external dll I have signals in a library, iris xmpp library, that I use in my application. Everything works fine on Mac OS X and Linux, but Windows produces a whole bunch of signals not found […]
- Trouble handling QClipboard::dataChanged() signal I am trying to make a Qt app that monitors changes to the system clipboard. Every time the user copies some text to the clipboard (outside the application), my app is supposed to change […]
- Instantiating/Accessing COM API from Qt I am trying to access a COM API of an application using Qt. However when I try to instantiate the COM API object I get:
D:\dev\git\com_example\Lights.h:441: error: undefined reference to […]
- Which QT Version/Build is more stable? I am a newbie to QT.
I used to play with QT examples on Win7 (32bit) and had a lot of fun.
Now I bought a new Win8 (64bit）PC and wanted to work with QT.
I installed that lasted vs 2012 […]