diff options
Diffstat (limited to 'src/gui/kernel/qstylehints.cpp')
-rw-r--r-- | src/gui/kernel/qstylehints.cpp | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp index 69de74e2c3..5029701f24 100644 --- a/src/gui/kernel/qstylehints.cpp +++ b/src/gui/kernel/qstylehints.cpp @@ -122,14 +122,15 @@ int QStyleHints::touchDoubleTapDistance() const } /*! - \property QStyleHints::appearance - \brief the appearance of the platform theme - \sa Qt::Appearance + \property QStyleHints::colorScheme + \brief the color scheme of the platform theme. + \sa Qt::ColorScheme \since 6.5 */ -Qt::Appearance QStyleHints::appearance() const +Qt::ColorScheme QStyleHints::colorScheme() const { - return d_func()->appearance(); + Q_D(const QStyleHints); + return d->colorScheme(); } /*! @@ -293,6 +294,7 @@ int QStyleHints::keyboardAutoRepeatRate() const /*! \property QStyleHints::keyboardAutoRepeatRateF + \since 6.5 \brief the rate, in events per second, in which additional repeated key presses will automatically be generated if a key is being held down. */ @@ -375,6 +377,8 @@ bool QStyleHints::showIsMaximized() const Since Qt 5.13, the setShowShortcutsInContextMenus() function can be used to override the platform default. + + \sa Qt::AA_DontShowShortcutsInContextMenus */ bool QStyleHints::showShortcutsInContextMenus() const { @@ -591,16 +595,21 @@ int QStyleHints::mouseQuickSelectionThreshold() const /*! \internal - QStyleHintsPrivate::setAppearance - set a new appearance. - Set \a appearance as the new appearance of the QStyleHints. - The appearanceChanged signal will be emitted if present and new appearance differ. + QStyleHintsPrivate::updateColorScheme - set a new color scheme. + + This function is called by the QPA plugin when the system theme changes. This in + turn might be the result of an explicit request of a color scheme via setColorScheme. + + Set \a colorScheme as the new color scheme of the QStyleHints. + The colorSchemeChanged signal will be emitted if present and new color scheme differ. */ -void QStyleHintsPrivate::setAppearance(Qt::Appearance appearance) +void QStyleHintsPrivate::updateColorScheme(Qt::ColorScheme colorScheme) { - if (m_appearance != appearance) { - m_appearance = appearance; - emit q_func()->appearanceChanged(appearance); - } + if (m_colorScheme == colorScheme) + return; + m_colorScheme = colorScheme; + Q_Q(QStyleHints); + emit q->colorSchemeChanged(colorScheme); } QStyleHintsPrivate *QStyleHintsPrivate::get(QStyleHints *q) |