6#include <QtCore/qdebug.h>
8#include <QtCore/qsettings.h>
10#include <QtQml/qqmlinfo.h>
11#include <QtQuickControls2/private/qquickstyle_p.h>
143 m_explicitTheme =
true;
144 if (m_theme ==
theme)
157 if (m_explicitTheme || m_theme ==
theme)
180 if (!m_explicitTheme)
183 m_explicitTheme =
false;
196 if (!variantToRgba(
var,
"accent", &
accent))
199 m_explicitAccent =
true;
210 if (m_explicitAccent || m_accent ==
accent)
230 if (!m_explicitAccent)
233 m_explicitAccent =
false;
251 m_hasForeground =
true;
252 m_explicitForeground =
true;
263 if (m_explicitForeground || m_foreground ==
foreground)
266 m_hasForeground = has;
284 if (!m_explicitForeground)
287 m_hasForeground =
false;
288 m_explicitForeground =
false;
306 m_hasBackground =
true;
307 m_explicitBackground =
true;
318 if (m_explicitBackground || m_background ==
background)
321 m_hasBackground = has;
339 if (!m_explicitBackground)
342 m_hasBackground =
false;
343 m_explicitBackground =
false;
490template <
typename Enum>
493 QMetaEnum enumeration = QMetaEnum::fromType<Enum>();
500#if QT_CONFIG(settings)
513 Theme themeEnum = toEnumValue<Theme>(themeValue, &
ok);
516 else if (!themeValue.
isEmpty())
517 qWarning().nospace().noquote() <<
"Universal: unknown theme value: " << themeValue;
520 Color accentEnum = toEnumValue<Color>(accentValue, &
ok);
523 }
else if (!accentValue.
isEmpty()) {
528 qWarning().nospace().noquote() <<
"Universal: unknown accent value: " << accentValue;
532 Color foregroundEnum = toEnumValue<Color>(foregroundValue, &
ok);
536 }
else if (!foregroundValue.
isEmpty()) {
538 if (
color.isValid()) {
542 qWarning().nospace().noquote() <<
"Universal: unknown foreground value: " << foregroundValue;
547 Color backgroundEnum = toEnumValue<Color>(backgroundValue, &
ok);
551 }
else if (!backgroundValue.
isEmpty()) {
553 if (
color.isValid()) {
557 qWarning().nospace().noquote() <<
"Universal: unknown background value: " << backgroundValue;
562bool QQuickUniversalStyle::variantToRgba(
const QVariant &
var,
const char *
name,
QRgb *rgba)
const
566 if (val < Lime || val >
Taupe) {
577 if (!
color.isValid()) {
581 *rgba =
color.rgba();
589#include "moc_qquickuniversalstyle_p.cpp"
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
The QColor class provides colors based on RGB, HSV or CMYK values.
static QColor fromRgba(QRgb rgba) noexcept
Static convenience function that returns a QColor constructed from the given QRgb value rgba.
static QColor fromString(QAnyStringView name) noexcept
QObject * parent() const
Returns a pointer to the parent object.
The QQuickAttachedPropertyPropagator class provides a way to propagate attached properties.
QQuickAttachedPropertyPropagator * attachedParent() const
This function returns the attached parent of this attached object.
QList< QQuickAttachedPropertyPropagator * > attachedChildren() const
This function returns the attached children of this attached object.
void initialize()
Finds and sets the attached parent for this attached object, and then does the same for its children.
static QSharedPointer< QSettings > settings(const QString &group=QString())
static bool isDarkSystemTheme()
QColor chromeBlackHighColor
void setForeground(const QVariant &foreground)
QColor baseMediumLowColor
QColor chromeBlackLowColor
QColor chromeBlackMediumColor
QColor chromeDisabledHighColor
QColor chromeDisabledLowColor
Q_INVOKABLE QColor color(Color color) const
void inheritBackground(QRgb background, bool has)
QColor chromeBlackMediumLowColor
void propagateBackground()
void setAccent(const QVariant &accent)
void inheritForeground(QRgb foreground, bool has)
QColor chromeMediumLowColor
QColor systemColor(SystemColor role) const
void inheritTheme(Theme theme)
QColor altMediumHighColor
void inheritAccent(QRgb accent)
QColor baseMediumHighColor
static QQuickUniversalStyle * qmlAttachedProperties(QObject *object)
void propagateForeground()
QQuickUniversalStyle(QObject *parent=nullptr)
void attachedParentChange(QQuickAttachedPropertyPropagator *newParent, QQuickAttachedPropertyPropagator *oldParent) override
This function is called whenever the attached parent of this QQuickAttachedPropertyPropagator changes...
static void initGlobals()
void setTheme(Theme theme)
void setBackground(const QVariant &background)
QVariant value(QAnyStringView key, const QVariant &defaultValue) const
Returns the value for setting key.
\macro QT_RESTRICTED_CAST_FROM_ASCII
int toInt(bool *ok=nullptr) const
Returns the variant as an int if the variant has userType() \l QMetaType::Int, \l QMetaType::Bool,...
QString toString() const
Returns the variant as a QString if the variant has a userType() including, but not limited to:
QByteArray toByteArray() const
Returns the variant as a QByteArray if the variant has userType() \l QMetaType::QByteArray or \l QMet...
QMetaType metaType() const
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
static QByteArray resolveSetting(const QByteArray &env, const QSharedPointer< QSettings > &settings, const QString &name)
static QT_BEGIN_NAMESPACE const QRgb colors[][14]
static QQuickUniversalStyle::Theme GlobalTheme
static bool HasGlobalForeground
static QByteArray resolveSetting(const QByteArray &env, const QSharedPointer< QSettings > &settings, const QString &name)
static Enum toEnumValue(const QByteArray &value, bool *ok)
static QT_BEGIN_NAMESPACE QRgb qquickuniversal_light_color(QQuickUniversalStyle::SystemColor role)
static QRgb qquickuniversal_dark_color(QQuickUniversalStyle::SystemColor role)
static QRgb GlobalForeground
static bool HasGlobalBackground
static QQuickUniversalStyle::Theme qquickuniversal_effective_theme(QQuickUniversalStyle::Theme theme)
static QRgb qquickuniversal_accent_color(QQuickUniversalStyle::Color accent)
static QRgb GlobalBackground
QT_BEGIN_NAMESPACE typedef unsigned int QRgb
#define QStringLiteral(str)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
QSettings settings("MySoft", "Star Runner")
[0]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent