From c8cf0f17b80b143f3543067a82c1aa29f0e4e386 Mon Sep 17 00:00:00 2001 From: Axel Spoerl Date: Thu, 15 Sep 2022 15:16:35 +0200 Subject: [PATCH] Add enum class Qt::Appearance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It has been decided to add an appearance property in QStyleHints, which will be propagated to classes that do not include QPlatformTheme. Therefore an appearance enum class is added to the Qt namespace, thus being available to all Qt classes. Task-number: QTBUG-106383 Change-Id: Icff94b0d7adca954ce74241d6811401d41f053e6 Reviewed-by: Tor Arne Vestbø --- src/corelib/global/qnamespace.h | 7 +++++++ src/corelib/global/qnamespace.qdoc | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 5c8ed2e8e5..52a9099964 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -46,6 +46,12 @@ namespace Qt { transparent }; + enum class Appearance { + Unknown = 0x0000, + Light = 0x0001, + Dark = 0x0002 + }; + enum MouseButton { NoButton = 0x00000000, LeftButton = 0x00000001, @@ -1745,6 +1751,7 @@ namespace Qt { Q_ENUM_NS(DayOfWeek) Q_ENUM_NS(CursorShape) Q_ENUM_NS(GlobalColor) + Q_ENUM_NS(Appearance) Q_ENUM_NS(AspectRatioMode) Q_ENUM_NS(TransformationMode) Q_FLAG_NS(ImageConversionFlags) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 23e3e9736b..22092a2dae 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -788,6 +788,17 @@ \sa QDockWidget::setAllowedAreas, QDockWidget::isAreaAllowed */ +/*! + \enum Qt::Appearance + + Represents the appearance of an application's theme, + defined by QGuiApplication::palette(). + + \value Unknown The appearance is unknown. + \value Light The background colors are lighter than the text color, i.e. the theme is light. + \value Dark The background colors are darker than the text color, i.e. the theme is dark. +*/ + /*! \enum Qt::ImageConversionFlag