Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickmaterialstyle.cpp File Reference

(302124c03294df180add61928b7c444e2847d840)

#include "qquickmaterialstyle_p.h"
#include <QtCore/qdebug.h>
#include <QtQml/qqmlinfo.h>
#include <QtQuickControls2/private/qquickstyle_p.h>
#include "moc_qquickmaterialstyle_p.cpp"
+ Include dependency graph for qquickmaterialstyle.cpp:

Go to the source code of this file.

Functions

static QQuickMaterialStyle::Theme effectiveTheme (QQuickMaterialStyle::Theme theme)
 
static QColor lighterShade (const QColor &color, qreal amount)
 
static QColor darkerShade (const QColor &color, qreal amount)
 
template<typename Enum >
static Enum toEnumValue (const QByteArray &value, bool *ok)
 
static QByteArray resolveSetting (const QByteArray &env, const QSharedPointer< QSettings > &settings, const QString &name)
 

Variables

static QT_BEGIN_NAMESPACE const QRgb colors [][14]
 
static QQuickMaterialStyle::Theme globalTheme = QQuickMaterialStyle::Light
 
static uint globalPrimary = QQuickMaterialStyle::Indigo
 
static uint globalAccent = QQuickMaterialStyle::Pink
 
static uint globalForeground = 0xDD000000
 
static uint globalBackground = 0xFFFAFAFA
 
static bool hasGlobalForeground = false
 
static bool hasGlobalBackground = false
 
static bool globalPrimaryCustom = false
 
static bool globalAccentCustom = false
 
static bool globalForegroundCustom = true
 
static bool globalBackgroundCustom = true
 
static QQuickMaterialStyle::Variant globalVariant = QQuickMaterialStyle::Normal
 
static const QRgb backgroundColorLight = 0xFFFFFBFE
 
static const QRgb backgroundColorDark = 0xFF1C1B1F
 
static const QRgb dialogColorLight = 0xFFFFFFFF
 
static const QRgb dialogColorDark = 0xFF424242
 
static const QRgb primaryTextColorLight = 0xDD000000
 
static const QRgb primaryTextColorDark = 0xFFFFFFFF
 
static const QRgb secondaryTextColorLight = 0x89000000
 
static const QRgb secondaryTextColorDark = 0xB2FFFFFF
 
static const QRgb hintTextColorLight = 0x60000000
 
static const QRgb hintTextColorDark = 0x4CFFFFFF
 
static const QRgb dividerColorLight = 0x1E000000
 
static const QRgb dividerColorDark = 0x1EFFFFFF
 
static const QRgb iconColorLight = 0x89000000
 
static const QRgb iconColorDark = 0xFFFFFFFF
 
static const QRgb iconDisabledColorLight = 0x42000000
 
static const QRgb iconDisabledColorDark = 0x4CFFFFFF
 
static const QRgb raisedButtonColorLight = 0xFFD6D7D7
 
static const QRgb raisedButtonColorDark = 0x3FCCCCCC
 
static const QRgb raisedButtonDisabledColorLight = dividerColorLight
 
static const QRgb raisedButtonDisabledColorDark = dividerColorDark
 
static const QRgb frameColorLight = hintTextColorLight
 
static const QRgb frameColorDark = hintTextColorDark
 
static const QRgb rippleColorLight = 0x10000000
 
static const QRgb rippleColorDark = 0x20FFFFFF
 
static const QRgb spinBoxDisabledIconColorLight = 0xFFCCCCCC
 
static const QRgb spinBoxDisabledIconColorDark = 0xFF666666
 
static const QRgb sliderDisabledColorLight = 0xFF9E9E9E
 
static const QRgb sliderDisabledColorDark = 0xFF616161
 
static const QRgb switchUncheckedTrackColorLight = 0xFFE7E0EC
 
static const QRgb switchUncheckedTrackColorDark = 0x49454F
 
static const QRgb switchDisabledUncheckedTrackColorLight = 0x1EE7E0EC
 
static const QRgb switchDisabledUncheckedTrackColorDark = 0x1E49454F
 
static const QRgb switchDisabledUncheckedTrackBorderColorLight = 0x1E1C1B1F
 
static const QRgb switchDisabledUncheckedTrackBorderColorDark = 0x1EE6E1E5
 
static const QRgb switchDisabledCheckedTrackColorLight = 0x1E1C1B1F
 
static const QRgb switchDisabledCheckedTrackColorDark = 0x1EE6E1E5
 
static const QRgb switchDisabledUncheckedIconColorLight = 0x611C1B1F
 
static const QRgb switchDisabledUncheckedIconColorDark = 0x61E6E1E5
 
static const QRgb textFieldFilledContainerColorLight = 0xFFE7E0EC
 
static const QRgb textFieldFilledContainerColorDark = 0xFF49454F
 

Function Documentation

◆ darkerShade()

static QColor darkerShade ( const QColor & color,
qreal amount )
static

Definition at line 1191 of file qquickmaterialstyle.cpp.

References QColor::setHslF(), and QColor::toHsl().

Referenced by QQuickMaterialStyle::shade().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ effectiveTheme()

static QQuickMaterialStyle::Theme effectiveTheme ( QQuickMaterialStyle::Theme theme)
static

Definition at line 430 of file qquickmaterialstyle.cpp.

References QQuickMaterialStyle::Dark, QQuickStylePrivate::isDarkSystemTheme(), QQuickMaterialStyle::Light, and QQuickMaterialStyle::System.

Referenced by QQuickMaterialStyle::initGlobals().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lighterShade()

static QColor lighterShade ( const QColor & color,
qreal amount )
static

Definition at line 1184 of file qquickmaterialstyle.cpp.

References QColor::setHslF(), and QColor::toHsl().

Referenced by QQuickMaterialStyle::shade().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resolveSetting()

static QByteArray resolveSetting ( const QByteArray & env,
const QSharedPointer< QSettings > & settings,
const QString & name )
static

Definition at line 1409 of file qquickmaterialstyle.cpp.

References qgetenv(), settings, QVariant::toByteArray(), and QSettings::value().

+ Here is the call graph for this function:

◆ toEnumValue()

template<typename Enum >
static Enum toEnumValue ( const QByteArray & value,
bool * ok )
static

Definition at line 1403 of file qquickmaterialstyle.cpp.

References QMetaEnum::keyToValue(), and ok.

+ Here is the call graph for this function:

Variable Documentation

◆ backgroundColorDark

const QRgb backgroundColorDark = 0xFF1C1B1F
static

Definition at line 364 of file qquickmaterialstyle.cpp.

◆ backgroundColorLight

const QRgb backgroundColorLight = 0xFFFFFBFE
static

Definition at line 363 of file qquickmaterialstyle.cpp.

◆ colors

◆ dialogColorDark

const QRgb dialogColorDark = 0xFF424242
static

Definition at line 366 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::dialogColor().

◆ dialogColorLight

const QRgb dialogColorLight = 0xFFFFFFFF
static

Definition at line 365 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::dialogColor().

◆ dividerColorDark

const QRgb dividerColorDark = 0x1EFFFFFF
static

Definition at line 374 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::dividerColor().

◆ dividerColorLight

const QRgb dividerColorLight = 0x1E000000
static

Definition at line 373 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::dividerColor().

◆ frameColorDark

const QRgb frameColorDark = hintTextColorDark
static

Definition at line 384 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::frameColor().

◆ frameColorLight

const QRgb frameColorLight = hintTextColorLight
static

Definition at line 383 of file qquickmaterialstyle.cpp.

◆ globalAccent

◆ globalAccentCustom

bool globalAccentCustom = false
static

Definition at line 356 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::initGlobals().

◆ globalBackground

uint globalBackground = 0xFFFAFAFA
static

◆ globalBackgroundCustom

bool globalBackgroundCustom = true
static

Definition at line 358 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::initGlobals().

◆ globalForeground

uint globalForeground = 0xDD000000
static

◆ globalForegroundCustom

bool globalForegroundCustom = true
static

Definition at line 357 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::initGlobals().

◆ globalPrimary

◆ globalPrimaryCustom

bool globalPrimaryCustom = false
static

Definition at line 355 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::initGlobals().

◆ globalTheme

◆ globalVariant

◆ hasGlobalBackground

bool hasGlobalBackground = false
static

Definition at line 352 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::initGlobals().

◆ hasGlobalForeground

bool hasGlobalForeground = false
static

Definition at line 351 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::initGlobals().

◆ hintTextColorDark

const QRgb hintTextColorDark = 0x4CFFFFFF
static

Definition at line 372 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::hintTextColor().

◆ hintTextColorLight

const QRgb hintTextColorLight = 0x60000000
static

Definition at line 371 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::hintTextColor().

◆ iconColorDark

const QRgb iconColorDark = 0xFFFFFFFF
static

Definition at line 376 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::iconColor().

◆ iconColorLight

const QRgb iconColorLight = 0x89000000
static

Definition at line 375 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::iconColor().

◆ iconDisabledColorDark

const QRgb iconDisabledColorDark = 0x4CFFFFFF
static

Definition at line 378 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::iconDisabledColor().

◆ iconDisabledColorLight

const QRgb iconDisabledColorLight = 0x42000000
static

Definition at line 377 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::iconDisabledColor().

◆ primaryTextColorDark

◆ primaryTextColorLight

const QRgb primaryTextColorLight = 0xDD000000
static

◆ raisedButtonColorDark

const QRgb raisedButtonColorDark = 0x3FCCCCCC
static

Definition at line 380 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::buttonColor().

◆ raisedButtonColorLight

const QRgb raisedButtonColorLight = 0xFFD6D7D7
static

Definition at line 379 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::buttonColor().

◆ raisedButtonDisabledColorDark

const QRgb raisedButtonDisabledColorDark = dividerColorDark
static

Definition at line 382 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::buttonColor().

◆ raisedButtonDisabledColorLight

const QRgb raisedButtonDisabledColorLight = dividerColorLight
static

Definition at line 381 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::buttonColor().

◆ rippleColorDark

const QRgb rippleColorDark = 0x20FFFFFF
static

Definition at line 386 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::rippleColor().

◆ rippleColorLight

const QRgb rippleColorLight = 0x10000000
static

Definition at line 385 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::rippleColor().

◆ secondaryTextColorDark

const QRgb secondaryTextColorDark = 0xB2FFFFFF
static

Definition at line 370 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::secondaryTextColor().

◆ secondaryTextColorLight

const QRgb secondaryTextColorLight = 0x89000000
static

Definition at line 369 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::secondaryTextColor().

◆ sliderDisabledColorDark

const QRgb sliderDisabledColorDark = 0xFF616161
static

Definition at line 390 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::sliderDisabledColor().

◆ sliderDisabledColorLight

const QRgb sliderDisabledColorLight = 0xFF9E9E9E
static

Definition at line 389 of file qquickmaterialstyle.cpp.

Referenced by QQuickMaterialStyle::sliderDisabledColor().

◆ spinBoxDisabledIconColorDark

const QRgb spinBoxDisabledIconColorDark = 0xFF666666
static

◆ spinBoxDisabledIconColorLight

const QRgb spinBoxDisabledIconColorLight = 0xFFCCCCCC
static

◆ switchDisabledCheckedTrackColorDark

const QRgb switchDisabledCheckedTrackColorDark = 0x1EE6E1E5
static

◆ switchDisabledCheckedTrackColorLight

const QRgb switchDisabledCheckedTrackColorLight = 0x1E1C1B1F
static

◆ switchDisabledUncheckedIconColorDark

const QRgb switchDisabledUncheckedIconColorDark = 0x61E6E1E5
static

◆ switchDisabledUncheckedIconColorLight

const QRgb switchDisabledUncheckedIconColorLight = 0x611C1B1F
static

◆ switchDisabledUncheckedTrackBorderColorDark

const QRgb switchDisabledUncheckedTrackBorderColorDark = 0x1EE6E1E5
static

◆ switchDisabledUncheckedTrackBorderColorLight

const QRgb switchDisabledUncheckedTrackBorderColorLight = 0x1E1C1B1F
static

◆ switchDisabledUncheckedTrackColorDark

const QRgb switchDisabledUncheckedTrackColorDark = 0x1E49454F
static

◆ switchDisabledUncheckedTrackColorLight

const QRgb switchDisabledUncheckedTrackColorLight = 0x1EE7E0EC
static

◆ switchUncheckedTrackColorDark

const QRgb switchUncheckedTrackColorDark = 0x49454F
static

◆ switchUncheckedTrackColorLight

const QRgb switchUncheckedTrackColorLight = 0xFFE7E0EC
static

◆ textFieldFilledContainerColorDark

const QRgb textFieldFilledContainerColorDark = 0xFF49454F
static

◆ textFieldFilledContainerColorLight

const QRgb textFieldFilledContainerColorLight = 0xFFE7E0EC
static