* In KDE Plasma, it uses the actually selected Qt style. It can be configured using ''KDE System Settings'' (''systemsettings5''), the settings can be found in ''Appearance > Application Style > Widget Style''.

* {{App|[[Wikipedia:QtCurve|QtCurve]]|A very configurable and popular desktop theme with support for GTK+ and Qt applications.|http://kde-look.org/content/show.php?content&#61;40492|{{AUR|qtcurve-kde3}}{{Broken package link|{{aur-mirror|qtcurve-kde3}}}} {{Pkg|qtcurve-kde4}}{{Broken package link|package not found}}}}

−

* {{App|Skulpture|A GUI style addon for KDE and Qt programs that features a classical three dimensional artwork with shadows and smooth gradients to enhance the visual experience.|http://kde-look.org/content/show.php/?content&#61;59031|{{AUR|skulpture}}{{Broken package link|{{aur-mirror|skulpture}}}}}}

−

* {{App|Polymer|A port of the KDE Plastik Style to Qt3.|http://kde-look.org/content/show.php?content&#61;21748|{{AUR|polymer}}}}

Qt keeps all its configuration information in {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific). The file is rather difficult to navigate because it contains a lot of information not related to appearance, but for any changes you can just add to the end of the file and overwrite any previous values (make sure to add your modification under the [Qt] header).

−

−

Qt fonts can be configured from ''QtConfig'' under ''Fonts > Default Font''.

−

−

==== 图标 ====

−

−

There is no way of setting the icon theme from ''QtConfig'', but since Qt follows the [http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html Freedesktop.org Icon Specification], any theme set for X is picked up by Qt.

−

−

=== 手动配置 ===

−

−

Qt keeps all its configuration information in {{ic|~/.config/Trolltech.conf}}. The file is rather difficult to navigate because it contains a lot of information not related to appearance, but for any changes you can just add to the end of the file and overwrite any previous values (make sure to add your modification under the {{ic|[Qt]}} header).

* {{App|QtCurve|A configurable set of widget styles for KDE and Gtk.|https://projects.kde.org/projects/playground/base/qtcurve|{{Pkg|qtcurve-qt4}}}}

+

* {{App|Adwaita-Qt| A style to bend Qt applications to look like they belong into GNOME Shell.|https://github.com/MartinBriza/adwaita-qt|{{AUR|adwaita-qt4}}}}

+

+

=== Qt5 ===

+

Qt5 decides the style to use based on what desktop environment is used:

+

* In KDE Plasma, it uses the actually selected Qt style. It can be configured using ''KDE System Settings'' (''systemsettings5''), the settings can be found in ''Appearance > Application Style > Widget Style''.

To force a specific style, you can set the {{ic|1=QT_STYLE_OVERRIDE}} [[environment variable]]. Specifically, set it to {{ic|gtk2}} if you want to use the [[GTK+]] theme (Note: you will need to install the Qt style plugins mention below to get the GTK+ style). Qt5 applications also support the {{ic|-style}} flag, which you can use to launch a Qt5 application with a specific style.

+

+

The following styles are included in Qt5: ''Fusion'', ''Windows''. Others can be installed from the official repositories:

+

* {{App|Breeze|Artwork, styles and assets for the Breeze visual style for the Plasma Desktop.|https://projects.kde.org/projects/kde/workspace/breeze|{{Pkg|breeze}}}}

An interesting way of customizing the look and feel of a Qt application is using Style Sheets, which are just simple CSS files. Using Style Sheets, one can modify the appearance of every widget in the application.

An interesting way of customizing the look and feel of a Qt application is using Style Sheets, which are just simple CSS files. Using Style Sheets, one can modify the appearance of every widget in the application.

To run an application with a different style just execute:

To run an application with a different style just execute:

−

$ qt_application --stylesheet style.qss

+

$ qt_application -stylesheet ''style.qss''

−

For more information on Qt Style Sheets see the [http://qt-project.org/doc/qt-4.8/stylesheet-reference.html official documentation] or other [http://thesmithfam.org/blog/2009/09/10/qt-stylesheets-tutorial/ tutorials]. As an example Style Sheet see this [http://kde-apps.org/content/show.php/roxydoxy?content&#61;125979 Dolphin modification].

+

For more information on Qt Style Sheets see the [http://doc.qt.io/qt-5/stylesheet-reference.html official documentation] or other [http://thesmithfam.org/blog/2009/09/10/qt-stylesheets-tutorial/ tutorials]. As an example Style Sheet see this [http://kde-apps.org/content/show.php/roxydoxy?content&#61;125979 Dolphin modification].

Unlike Qt4, Qt5 doesn't ship a qtconfig utility to configure fonts, icons or styles. Instead, it will try to use the settings from the running DE. In KDE or GNOME this works well, but in other less popular DEs or WM it can lead to missing icons in Qt5 applications. One way to solve this is to fake the running desktop environment by setting

+

{{ic|1=XDG_CURRENT_DESKTOP=KDE}} or {{ic|GNOME}}, and then using the corresponding configuration application to set the desired icon set.

+

+

Another solution is provided by the {{pkg|qt5ct}} package, which provides a DE independent Qt5 QPA and a configuration utility. After installing the package, run {{ic|qt5ct}} to set an icon theme, and set the environment variable {{ic|1=QT_QPA_PLATFORMTHEME="qt5ct"}} so that the settings are picked up by Qt applications. Alternatively, use {{ic|--platformtheme qt5ct}} as argument to the Qt5 application.

+

+

To automatically set {{ic|QT_QPA_PLATFORMTHEME}} for user session, add the following line to {{ic|~/.profile}}.

This will export {{ic|QT_QPA_PLATFORMTHEME}} environment variable for the whole user session. Note that this doesn't work on [[enlightenment]] because it has its own custom environment variable setting instead of getting it from {{ic|~/.profile}} file.

+

+

If the below errors are received, and some icons still do not appear in some of the apps, install {{pkg|oxygen}} and {{pkg|oxygen-icons}}:

Qt keeps all its configuration information in /etc/xdg/Trolltech.conf (system-wide) or ~/.config/Trolltech.conf (user-specific). The file is rather difficult to navigate because it contains a lot of information not related to appearance, but for any changes you can just add to the end of the file and overwrite any previous values (make sure to add your modification under the [Qt] header).

To force a specific style, you can set the QT_STYLE_OVERRIDEenvironment variable. Specifically, set it to gtk2 if you want to use the GTK+ theme (Note: you will need to install the Qt style plugins mention below to get the GTK+ style). Qt5 applications also support the -style flag, which you can use to launch a Qt5 application with a specific style.

The following styles are included in Qt5: Fusion, Windows. Others can be installed from the official repositories:

Breeze — Artwork, styles and assets for the Breeze visual style for the Plasma Desktop.

Qt 样式表

An interesting way of customizing the look and feel of a Qt application is using Style Sheets, which are just simple CSS files. Using Style Sheets, one can modify the appearance of every widget in the application.

GTK+ 和 Qt

Configuration of Qt5 apps under environments other than KDE

Unlike Qt4, Qt5 doesn't ship a qtconfig utility to configure fonts, icons or styles. Instead, it will try to use the settings from the running DE. In KDE or GNOME this works well, but in other less popular DEs or WM it can lead to missing icons in Qt5 applications. One way to solve this is to fake the running desktop environment by setting
XDG_CURRENT_DESKTOP=KDE or GNOME, and then using the corresponding configuration application to set the desired icon set.

Another solution is provided by the qt5ct package, which provides a DE independent Qt5 QPA and a configuration utility. After installing the package, run qt5ct to set an icon theme, and set the environment variable QT_QPA_PLATFORMTHEME="qt5ct" so that the settings are picked up by Qt applications. Alternatively, use --platformtheme qt5ct as argument to the Qt5 application.

To automatically set QT_QPA_PLATFORMTHEME for user session, add the following line to ~/.profile.

This will export QT_QPA_PLATFORMTHEME environment variable for the whole user session. Note that this doesn't work on enlightenment because it has its own custom environment variable setting instead of getting it from ~/.profile file.

If the below errors are received, and some icons still do not appear in some of the apps, install oxygen and oxygen-icons:

rcc — A tool that is used to embed resources (such as pictures) into a Qt application during the build process. It works by generating a C++ source file containing data specified in a Qt resource (.qrc) file.