How to apply qtcreator's light flat theme to my app?
-
Hi,
The new theme of QtCreator looks nice and I want to apply to my application. However, I couldn't figure it out how to do it yet. Does anyone know how to achieve it?
https://blog.qt.io/blog/2015/02/09/qt-creator-flat-style-ui-design-new-light-theme/
Thanks
-
Hi
As far as I know , its not Qt style, but a private Creator theme
The files are here
C:\Qt\Tools\QtCreator\share\qtcreator\themes
Its based on the Fusion style and these files specify the actual colors used.
[Palette]
shadowBackground=ff404244
text=ffd0d0d0
textDisabled=60a4a6a8
...So you might be able to recreate it
QApplication::setStyle(QStyleFactory::create("Fusion"));
QPalette p;
p = qApp->palette();
p.setColor(QPalette::Window, QColor(53,53,53));
p.setColor(QPalette::Button, QColor(53,53,53));
p.setColor(QPalette::Highlight, QColor(142,45,197));
p.setColor(QPalette::ButtonText, QColor(255,255,255));
........
for all colors that matters..
qApp->setPalette(p);But as far I know, there is no way to just re-use it.
-
Thank you for the answer!
Qt should make it available as a style. It would be very nice if i can just enable it with '-style=fusion-dark-flat" or sth like that.
-
@muratkarakus7
Hi
Yeah you are not the first to want that.
Often they set the dark theme and first time they run the program they want it
to stay the same colors as in design mode. -
"Yeah you are not the first to want that."
Because it is commonsense :D -
@muratkarakus7
yeah, its easy to expect when using a WYSIWYG editor and all but the colors
are as shown as seen in design mode. :) -
Exactly!!!
-
@muratkarakus7
If a strong wish, you could ask the developers
qt-creator@qt-project.org.
If there a way to use it more easy than recreating it.I looked around a bit in the code but there seems to be more into play than
just loading the theme files for Creator. -
Just as a side note: Qt Quick Controls 2 support modern, flat styles (AKA "default", "material" and "universal") OOTB.