Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2018-06

theming

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner

Hi,

This has probably been asked a zillion times, but I can't find it.

How can I theme my qt4 app?
Not all qt4 apps, just this one.

I tried "export QT_STYLE_OVERRIDE=macintosh ./project1", but that didn't have an effect.

I can do it with QApplication_setStyleSheet(App, at stylesheet);, but App is private in TQtWidgetSet. So probably I'm missing something.

Mattias

zeljko
to Mattias Gaertner
Mattias Gaertner wrote 12 lines
Hi, This has probably been asked a zillion times, but I can't find it. How can I theme my qt4 app? Not all qt4 apps, just this one. I tried "export QT_STYLE_OVERRIDE=macintosh ./project1", but that didn't have an effect. I can do it with QApplication_setStyleSheet(App, at stylesheet);, but App is private in TQtWidgetSet. So probably I'm missing something.

Theme & QStyleSheet are two different things.
You cannot use all themes on all platforms.
eg. ./Myapp -style macintosh won't work under linux & win32, also ./Myapp -style winvista (or -winxp) won't work under linux & mac. There are "standard" themes inside qt:
1.windows
2.motif
3.plastique
4.cleanlooks (gtk2)
5.gtk (Qt4 uses gtk2 for this, Qt5 as of Qt-5.9.0 uses gtk3) Also, under KDE theme for qt libs is provided by KDE as plugin.

QApplication_setStyleSheet(QCoreApplication_instance(), @MyStyleSheet) works fine here.

zeljko