Revert "Let styles indicate that they support dark mode"

This reverts commit 3ee7a9f85c9d4566223f44f7bab04abafdfca82c.

Styles that don't support dark mode can overwrite the palette in
a QStyle::polish(QPalette &) override instead.

Change-Id: I8b84d822d91be5b3f67f76f791a1330bba7ea546
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
This commit is contained in:
Volker Hilsheimer 2022-12-08 09:20:31 +01:00
parent 501018ea33
commit c62c2aac75
6 changed files with 0 additions and 17 deletions

View File

@ -2892,9 +2892,6 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
case SH_TabBar_AllowWheelScrolling: case SH_TabBar_AllowWheelScrolling:
ret = false; ret = false;
break; break;
case SH_SupportsDarkAppearance:
ret = true;
break;
default: default:
ret = QCommonStyle::styleHint(sh, opt, w, hret); ret = QCommonStyle::styleHint(sh, opt, w, hret);
break; break;

View File

@ -2316,10 +2316,6 @@ int QWindowsVistaStyle::styleHint(StyleHint hint, const QStyleOption *option, co
ret = 1; ret = 1;
break; break;
case SH_SupportsDarkAppearance:
ret = 0;
break;
default: default:
ret = QWindowsStyle::styleHint(hint, option, widget, returnData); ret = QWindowsStyle::styleHint(hint, option, widget, returnData);
break; break;

View File

@ -5407,7 +5407,6 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
case SH_ItemView_PaintAlternatingRowColorsForEmptyArea: case SH_ItemView_PaintAlternatingRowColorsForEmptyArea:
case SH_ComboBox_UseNativePopup: case SH_ComboBox_UseNativePopup:
case SH_Table_AlwaysDrawLeftTopGridLines: case SH_Table_AlwaysDrawLeftTopGridLines:
case SH_SupportsDarkAppearance:
ret = false; ret = false;
break; break;
case SH_MenuBar_AltKeyNavigation: case SH_MenuBar_AltKeyNavigation:

View File

@ -3630,7 +3630,6 @@ int QFusionStyle::styleHint(StyleHint hint, const QStyleOption *option, const QW
case SH_MenuBar_MouseTracking: case SH_MenuBar_MouseTracking:
case SH_Menu_MouseTracking: case SH_Menu_MouseTracking:
case SH_Menu_SupportsSections: case SH_Menu_SupportsSections:
case SH_SupportsDarkAppearance:
return 1; return 1;
#if defined(QT_PLATFORM_UIKIT) #if defined(QT_PLATFORM_UIKIT)

View File

@ -1987,13 +1987,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
not when the header is hidden. Defaults to false. not when the header is hidden. Defaults to false.
This enum value has been introduced in Qt 6.3. This enum value has been introduced in Qt 6.3.
\value SH_SupportsDarkAppearance
Determines whether the style is able to render a UI correctly with
a dark palette. Defaults to false. Style implementors should return true
if they have tested the style with a palette where the background colors
are darker than the foreground colors.
This enum value has been introduced in Qt 6.5.
\sa styleHint() \sa styleHint()
*/ */

View File

@ -702,7 +702,6 @@ public:
SH_TabBar_AllowWheelScrolling, SH_TabBar_AllowWheelScrolling,
SH_Table_AlwaysDrawLeftTopGridLines, SH_Table_AlwaysDrawLeftTopGridLines,
SH_SpinBox_SelectOnStep, SH_SpinBox_SelectOnStep,
SH_SupportsDarkAppearance,
// Add new style hint values here // Add new style hint values here
SH_CustomBase = 0xf0000000 SH_CustomBase = 0xf0000000