Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqstylekittheme.cpp File Reference

(d5031b598808ced6ab08c8273ac5fff5e2e6c3e0)

#include <QtQuickTemplates2/private/qquicktheme_p.h>
#include <QtQuick/private/qquickpalette_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/qpa/qplatformtheme.h>
#include "qqstylekittheme_p.h"
#include "qqstylekitstyle_p.h"
#include "moc_qqstylekittheme_p.cpp"
Include dependency graph for qqstylekittheme.cpp:

Go to the source code of this file.

Functions

static QT_BEGIN_NAMESPACE QQuickTheme::Scope scopeForType (QQStyleKitExtendableControlType type)
 \qmltype Theme \inqmlmodule Qt.labs.StyleKit \inherits AbstractStyle

Function Documentation

◆ scopeForType()

\qmltype Theme \inqmlmodule Qt.labs.StyleKit \inherits AbstractStyle

Defines color and style overrides for a color scheme.

A Theme overrides properties defined in a \l Style to provide a distinct visual appearance for a particular color scheme. A style typically configures structural properties such as implicit size, padding, and radii, while a theme specifies colors, shadows, and other visual attributes. However, this is not a restriction — a theme can override any property that a style can set.

A style can provide a \l {Style::light}{light} and a \l {Style::dark}{dark} theme. When \l {Style::themeName}{themeName} is set to "System" (the default), the active theme follows the \l {QStyleHints::colorScheme}{operating system's color scheme}. You can also create additional themes using \l CustomTheme and \l {Style::themeName}{switch between them} at runtime.

Properties that are not set in the theme fall back to those defined in the \l Style.

The following example defines light, dark, and high-contrast themes, each providing different colors for the controls:

For a complete example showing themes in action, see the \l {StyleKit Example}.

\labs

See also
Style, CustomTheme

Definition at line 50 of file qqstylekittheme.cpp.