Qt custom look and feel?
Asked Answered
L

2

5

can I force my Qt application to use different look and feel just like it is done in KDE ?

Labrador answered 18/3, 2011 at 23:20 Comment(0)
G
5

You can always change styles of widgets using QApplication::setStyle. There are a few predefined options available in Qt4.

In main.cpp do something like this

#include <QPlastiqueStyle>

int main(int argc, char *argv[])
{
[...]

    QApplication::setStyle(new QPlastiqueStyle());
}

This way your application will alwyas look the same on different OS. In my opinion Plastique looks better under windowsXP/2000 then default QWindowsXPStyle. Cleanlooks is quite nice too.

There are other options:

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

I hope this helps.

Gustave answered 19/3, 2011 at 11:13 Comment(0)
E
2

You can use CSS to style widgets https://doc.qt.io/qt-5/stylesheet.html

Eared answered 18/3, 2011 at 23:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.