Qt custom appearance?

Can I force a Qt application to use a different look in the same way as in KDE?

+4
source share
2 answers

You can always change styles with widgets using QApplication :: setStyle. Qt4 has several predefined options.

In main.cpp, do something like this

#include <QPlastiqueStyle> int main(int argc, char *argv[]) { [...] QApplication::setStyle(new QPlastiqueStyle()); } 

Thus, your application will look the same on different operating systems. In my opinion, Plastique looks better under WindowsXP / 2000, and then QWindowsXPStyle by default. Cleanlooks programs also look great.

There are other options:

 #include <QPlastiqueStyle> #include <QCleanlooksStyle> #include <QWindowsXPStyle> #include <QWindowsVistaStyle> #include <QMotifStyle> #include <QCDEStyle> 

Hope this helps.

+5
source

You can use CSS for widget styles https://doc.qt.io/qt-5/stylesheet.html

+2
source

Source: https://habr.com/ru/post/1344335/


All Articles