[neon/qt6/qt6-base/Neon/unstable] debian/patches: Upstream patch to fix qpallet.

Scarlett Moore null at kde.org
Thu Sep 14 18:59:18 BST 2023


Git commit 944431c2d63ee114b25bb8818a666aac80668b02 by Scarlett Moore.
Committed on 14/09/2023 at 19:58.
Pushed by scarlettmoore into branch 'Neon/unstable'.

Upstream patch to fix qpallet.

A  +434  -0    debian/patches/4781de5.diff
M  +2    -0    debian/patches/series

https://invent.kde.org/neon/qt6/qt6-base/-/commit/944431c2d63ee114b25bb8818a666aac80668b02

diff --git a/debian/patches/4781de5.diff b/debian/patches/4781de5.diff
new file mode 100644
index 0000000..6b108e7
--- /dev/null
+++ b/debian/patches/4781de5.diff
@@ -0,0 +1,434 @@
+From 4781de58595a873d9b3f37233546b868cf802f75 Mon Sep 17 00:00:00 2001
+From: Santhosh Kumar <santhosh.kumar.selvaraj at qt.io>
+Date: Wed, 16 Aug 2023 13:56:29 +0200
+Subject: [PATCH] Rename accent color in QPalette
+
+Accent color role has been renamed according to name rule of other
+color roles in QPalette.
+
+Fixes: QTBUG-116107
+Change-Id: I70ac98a1e97afbdc7ea5f8d79f808c307e170712
+Reviewed-by: Mitch Curtis <mitch.curtis at qt.io>
+(cherry picked from commit 90980a54e87147ae59ed0628f8b1de67d98ecae4)
+Reviewed-by: Volker Hilsheimer <volker.hilsheimer at qt.io>
+---
+
+diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
+index e0c0860..84d09c1 100644
+--- a/src/gui/kernel/qpalette.cpp
++++ b/src/gui/kernel/qpalette.cpp
+@@ -16,15 +16,15 @@
+ 
+ static constexpr QPalette::ResolveMask colorRoleOffset(QPalette::ColorGroup colorGroup)
+ {
+-    // Exclude NoRole; that bit is used for AccentColor
++    // Exclude NoRole; that bit is used for Accent
+     return (qToUnderlying(QPalette::NColorRoles) - 1) * qToUnderlying(colorGroup);
+ }
+ 
+ static constexpr QPalette::ResolveMask bitPosition(QPalette::ColorGroup colorGroup,
+                                                    QPalette::ColorRole colorRole)
+ {
+-    // Map AccentColor into NoRole for resolving purposes
+-    if (colorRole == QPalette::AccentColor)
++    // Map Accent into NoRole for resolving purposes
++    if (colorRole == QPalette::Accent)
+         colorRole = QPalette::NoRole;
+ 
+     return colorRole + colorRoleOffset(colorGroup);
+@@ -113,12 +113,12 @@
+     // Act only for color groups where no accent color is set
+     for (int i = 0; i < QPalette::NColorGroups; ++i) {
+         const QPalette::ColorGroup group = static_cast<QPalette::ColorGroup>(i);
+-        if (!pal.isBrushSet(group, QPalette::AccentColor)) {
++        if (!pal.isBrushSet(group, QPalette::Accent)) {
+             // Default to highlight if available, otherwise use a shade of base
+             const QBrush accentBrush = pal.isBrushSet(group, QPalette::Highlight)
+                                      ? pal.brush(group, QPalette::Highlight)
+                                      : pal.brush(group, QPalette::Base).color().lighter(lighter);
+-            pal.setBrush(group, QPalette::AccentColor, accentBrush);
++            pal.setBrush(group, QPalette::Accent, accentBrush);
+         }
+     }
+ }
+@@ -548,7 +548,7 @@
+                        item. By default, the highlight color is
+                        Qt::darkBlue.
+ 
+-    \value [since 6.6] AccentColor
++    \value [since 6.6] Accent
+                        A color that typically contrasts or complements
+                        Base, Window and Button colors. It usually represents
+                        the users' choice of desktop personalisation.
+@@ -1022,7 +1022,7 @@
+     palette.detach();
+ 
+     for (int role = 0; role < int(NColorRoles); ++role) {
+-        // Don't resolve NoRole, its bits are needed for AccentColor (see bitPosition)
++        // Don't resolve NoRole, its bits are needed for Accent (see bitPosition)
+         if (role == NoRole)
+             continue;
+ 
+@@ -1161,9 +1161,9 @@
+                 p.setBrush(group, (QPalette::ColorRole)role, tmp);
+             }
+ 
+-            // AccentColor defaults to Highlight for stream versions that don't have it.
++            // Accent defaults to Highlight for stream versions that don't have it.
+             if (s.version() < QDataStream::Qt_6_6)
+-                p.setBrush(group, QPalette::AccentColor, p.brush(group, QPalette::Highlight));
++                p.setBrush(group, QPalette::Accent, p.brush(group, QPalette::Highlight));
+         }
+ 
+     }
+diff --git a/src/gui/kernel/qpalette.h b/src/gui/kernel/qpalette.h
+index 92d2502..7f05129 100644
+--- a/src/gui/kernel/qpalette.h
++++ b/src/gui/kernel/qpalette.h
+@@ -55,8 +55,8 @@
+                      NoRole,
+                      ToolTipBase, ToolTipText,
+                      PlaceholderText,
+-                     AccentColor,
+-                     NColorRoles = AccentColor + 1,
++                     Accent,
++                     NColorRoles = Accent + 1,
+                    };
+     Q_ENUM(ColorRole)
+ 
+@@ -99,7 +99,7 @@
+     inline const QBrush &link() const { return brush(Link); }
+     inline const QBrush &linkVisited() const { return brush(LinkVisited); }
+     inline const QBrush &placeholderText() const { return brush(PlaceholderText); }
+-    inline const QBrush &accentColor() const { return brush(AccentColor); }
++    inline const QBrush &accent() const { return brush(Accent); }
+ 
+     bool operator==(const QPalette &p) const;
+     inline bool operator!=(const QPalette &p) const { return !(operator==(p)); }
+diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp
+index 938a0da..f7f5470 100644
+--- a/src/gui/kernel/qplatformtheme.cpp
++++ b/src/gui/kernel/qplatformtheme.cpp
+@@ -395,9 +395,9 @@
+     fusionPalette.setBrush(QPalette::Inactive, QPalette::Highlight, highlight);
+     fusionPalette.setBrush(QPalette::Disabled, QPalette::Highlight, disabledHighlight);
+ 
+-    fusionPalette.setBrush(QPalette::Active, QPalette::AccentColor, highlight);
+-    fusionPalette.setBrush(QPalette::Inactive, QPalette::AccentColor, highlight);
+-    fusionPalette.setBrush(QPalette::Disabled, QPalette::AccentColor, disabledHighlight);
++    fusionPalette.setBrush(QPalette::Active, QPalette::Accent, highlight);
++    fusionPalette.setBrush(QPalette::Inactive, QPalette::Accent, highlight);
++    fusionPalette.setBrush(QPalette::Disabled, QPalette::Accent, disabledHighlight);
+ 
+     fusionPalette.setBrush(QPalette::PlaceholderText, placeholder);
+ 
+diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
+index 02d99a8..2082263 100644
+--- a/src/gui/text/qcssparser.cpp
++++ b/src/gui/text/qcssparser.cpp
+@@ -47,7 +47,7 @@
+     { "-qt-style-features", QtStyleFeatures },
+     { "-qt-table-type", QtTableType },
+     { "-qt-user-state", QtUserState },
+-    { "accent-color", QtAccentColor },
++    { "accent-color", QtAccent },
+     { "alternate-background-color", QtAlternateBackground },
+     { "background", Background },
+     { "background-attachment", BackgroundAttachment },
+@@ -1347,7 +1347,7 @@
+                                     QBrush *selectedBackground,
+                                     QBrush *alternateBackground,
+                                     QBrush *placeHolderTextForeground,
+-                                    QBrush *accentColor)
++                                    QBrush *accent)
+ {
+     bool hit = false;
+     for (int i = 0; i < declarations.size(); ++i) {
+@@ -1358,7 +1358,7 @@
+         case QtSelectionBackground: *selectedBackground = decl.brushValue(pal); break;
+         case QtAlternateBackground: *alternateBackground = decl.brushValue(pal); break;
+         case QtPlaceHolderTextColor: *placeHolderTextForeground = decl.brushValue(pal); break;
+-        case QtAccentColor: *accentColor = decl.brushValue(pal); break;
++        case QtAccent: *accent = decl.brushValue(pal); break;
+         default: continue;
+         }
+         hit = true;
+diff --git a/src/gui/text/qcssparser_p.h b/src/gui/text/qcssparser_p.h
+index 2017731..1369bdf 100644
+--- a/src/gui/text/qcssparser_p.h
++++ b/src/gui/text/qcssparser_p.h
+@@ -166,7 +166,7 @@
+     WordSpacing,
+     TextDecorationColor,
+     QtPlaceHolderTextColor,
+-    QtAccentColor,
++    QtAccent,
+     NumProperties
+ };
+ 
+@@ -826,7 +826,7 @@
+     bool extractOutline(int *borders, QBrush *colors, BorderStyle *Styles, QSize *radii, int *offsets);
+     bool extractPalette(QBrush *foreground, QBrush *selectedForeground, QBrush *selectedBackground,
+                         QBrush *alternateBackground, QBrush *placeHolderTextForeground,
+-                        QBrush *accentColor);
++                        QBrush *accent);
+     int  extractStyleFeatures();
+     bool extractImage(QIcon *icon, Qt::Alignment *a, QSize *size);
+     bool extractIcon(QIcon *icon, QSize *size);
+diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm
+index 3ef36cc..ac5bdf0 100644
+--- a/src/plugins/platforms/cocoa/qcocoatheme.mm
++++ b/src/plugins/platforms/cocoa/qcocoatheme.mm
+@@ -95,7 +95,7 @@
+     palette->setColor(QPalette::Disabled, QPalette::PlaceholderText, qc);
+ 
+     qc = qt_mac_toQColor([NSColor controlAccentColor]);
+-    palette->setColor(QPalette::AccentColor, qc);
++    palette->setColor(QPalette::Accent, qc);
+ 
+     return palette;
+ }
+diff --git a/src/plugins/platforms/ios/qiostheme.mm b/src/plugins/platforms/ios/qiostheme.mm
+index f1f6346..1572077 100644
+--- a/src/plugins/platforms/ios/qiostheme.mm
++++ b/src/plugins/platforms/ios/qiostheme.mm
+@@ -70,7 +70,7 @@
+     s_systemPalette.setBrush(QPalette::Highlight, QColor(11, 70, 150, 60));
+     s_systemPalette.setBrush(QPalette::HighlightedText, qt_mac_toQBrush(UIColor.labelColor.CGColor));
+ 
+-    s_systemPalette.setBrush(QPalette::AccentColor, qt_mac_toQBrush(UIColor.tintColor.CGColor));
++    s_systemPalette.setBrush(QPalette::Accent, qt_mac_toQBrush(UIColor.tintColor.CGColor));
+ }
+ 
+ const QPalette *QIOSTheme::palette(QPlatformTheme::Palette type) const
+diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
+index 872c78b..febec34 100644
+--- a/src/plugins/platforms/windows/qwindowstheme.cpp
++++ b/src/plugins/platforms/windows/qwindowstheme.cpp
+@@ -277,7 +277,7 @@
+     result.setColor(QPalette::Midlight, getSysColor(COLOR_3DLIGHT));
+     result.setColor(QPalette::Shadow, getSysColor(COLOR_3DDKSHADOW));
+     result.setColor(QPalette::HighlightedText, getSysColor(COLOR_HIGHLIGHTTEXT));
+-    result.setColor(QPalette::AccentColor, accent);
++    result.setColor(QPalette::Accent, accent);
+ 
+     result.setColor(QPalette::Link, linkColor);
+     result.setColor(QPalette::LinkVisited, accentDarkest);
+@@ -351,7 +351,7 @@
+     result.setColor(QPalette::All, QPalette::ToolTipBase, buttonColor);
+     result.setColor(QPalette::All, QPalette::ToolTipText, foreground.darker(120));
+     result.setColor(QPalette::All, QPalette::PlaceholderText, placeHolderColor(foreground));
+-    result.setColor(QPalette::All, QPalette::AccentColor, accent);
++    result.setColor(QPalette::All, QPalette::Accent, accent);
+ }
+ 
+ static inline QPalette toolTipPalette(const QPalette &systemPalette, bool light)
+@@ -591,7 +591,7 @@
+                         result.color(QPalette::Inactive, QPalette::Window));
+         result.setColor(QPalette::Inactive, QPalette::HighlightedText,
+                         result.color(QPalette::Inactive, QPalette::Text));
+-        result.setColor(QPalette::Inactive, QPalette::AccentColor,
++        result.setColor(QPalette::Inactive, QPalette::Accent,
+                         result.color(QPalette::Inactive, QPalette::Window));
+     }
+ 
+@@ -606,7 +606,7 @@
+     result.setColor(QPalette::Disabled, QPalette::ButtonText, disabled);
+     result.setColor(QPalette::Disabled, QPalette::Highlight, result.color(QPalette::Highlight));
+     result.setColor(QPalette::Disabled, QPalette::HighlightedText, result.color(QPalette::HighlightedText));
+-    result.setColor(QPalette::Disabled, QPalette::AccentColor, disabled);
++    result.setColor(QPalette::Disabled, QPalette::Accent, disabled);
+     result.setColor(QPalette::Disabled, QPalette::Base, result.window().color());
+     return result;
+ }
+diff --git a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
+index fa48777..50e5150 100644
+--- a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
++++ b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
+@@ -1345,7 +1345,7 @@
+     \row
+         \li \b{\c accent-color}
+         \li \l{#Brush}{Brush} \br
+-        \li The property sets the \c AccentColor, which is used to emphasize
++        \li The property sets the \c Accent, which is used to emphasize
+            interactive UI elements.
+            If this property is not set, it defaults to the \c highlight color.
+ 
+@@ -3056,7 +3056,7 @@
+     \row
+         \li \b{PaletteRole} \target PaletteRole
+         \li \c alternate-base \br
+-              | \c accentColor \br
++              | \c accent \br
+               | \c base \br
+               | \c bright-text \br
+               | \c button \br
+diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
+index 4c27199..e3ca85d 100644
+--- a/src/widgets/styles/qstylesheetstyle.cpp
++++ b/src/widgets/styles/qstylesheetstyle.cpp
+@@ -439,13 +439,13 @@
+                             const QBrush &selectedBackground,
+                             const QBrush &alternateBackground,
+                             const QBrush &placeHolderTextForeground,
+-                            const QBrush &accentColor)
++                            const QBrush &accent)
+         : foreground(foreground)
+         , selectionForeground(selectedForeground)
+         , selectionBackground(selectedBackground)
+         , alternateBackground(alternateBackground)
+         , placeholderForeground(placeHolderTextForeground)
+-        , accentColor(accentColor)
++        , accent(accent)
+      { }
+ 
+     QBrush foreground;
+@@ -453,7 +453,7 @@
+     QBrush selectionBackground;
+     QBrush alternateBackground;
+     QBrush placeholderForeground;
+-    QBrush accentColor;
++    QBrush accent;
+ };
+ 
+ struct QStyleSheetGeometryData : public QSharedData
+@@ -970,11 +970,11 @@
+     QBrush selectedBackground;
+     QBrush alternateBackground;
+     QBrush placeHolderTextForeground;
+-    QBrush accentColor;
++    QBrush accent;
+     if (v.extractPalette(&foreground, &selectedForeground, &selectedBackground,
+-                         &alternateBackground, &placeHolderTextForeground, &accentColor)) {
++                         &alternateBackground, &placeHolderTextForeground, &accent)) {
+         pal = new QStyleSheetPaletteData(foreground, selectedForeground, selectedBackground,
+-                                         alternateBackground, placeHolderTextForeground, accentColor);
++                                         alternateBackground, placeHolderTextForeground, accent);
+     }
+ 
+     QIcon imgIcon;
+@@ -1514,8 +1514,8 @@
+         p->setBrush(cg, QPalette::AlternateBase, pal->alternateBackground);
+     if (pal->placeholderForeground.style() != Qt::NoBrush)
+         p->setBrush(cg, QPalette::PlaceholderText, pal->placeholderForeground);
+-    if (pal->accentColor.style() != Qt::NoBrush)
+-        p->setBrush(cg, QPalette::AccentColor, pal->accentColor);
++    if (pal->accent.style() != Qt::NoBrush)
++        p->setBrush(cg, QPalette::Accent, pal->accent);
+ }
+ 
+ bool QRenderRule::hasModification() const
+diff --git a/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
+index 3c9a83c..7ceab6d 100644
+--- a/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
++++ b/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
+@@ -295,7 +295,7 @@
+     QPalette::PlaceholderText + 1, // Qt_5_12
+     QPalette::PlaceholderText + 1, // Qt_5_13, Qt_5_14, Qt_5_15
+     QPalette::PlaceholderText + 1, // Qt_6_0
+-    QPalette::AccentColor + 1,     // Qt_6_6
++    QPalette::Accent + 1,     // Qt_6_6
+     0                              // add the correct value for Qt_5_14 here later
+ };
+ 
+@@ -2393,7 +2393,7 @@
+     */
+ 
+     // revise the test if new color roles or color groups are added
+-    QCOMPARE(QPalette::NColorRoles, QPalette::AccentColor + 1);
++    QCOMPARE(QPalette::NColorRoles, QPalette::Accent + 1);
+     QCOMPARE(static_cast<int>(QPalette::NColorGroups), 3);
+ 
+     QByteArray ba2;
+diff --git a/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp b/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
+index bf97997..e5f3e3d 100644
+--- a/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
++++ b/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
+@@ -52,7 +52,7 @@
+     QTest::newRow("QPalette::ToolTipBase") << int(QPalette::ToolTipBase) << 18;
+     QTest::newRow("QPalette::ToolTipText") << int(QPalette::ToolTipText) << 19;
+     QTest::newRow("QPalette::PlaceholderText") << int(QPalette::PlaceholderText) << 20;
+-    QTest::newRow("QPalette::AccentColor") << int(QPalette::AccentColor) << 21;
++    QTest::newRow("QPalette::Accent") << int(QPalette::Accent) << 21;
+ 
+     // Change this value as you add more roles.
+     QTest::newRow("QPalette::NColorRoles") << int(QPalette::NColorRoles) << 22;
+@@ -355,9 +355,9 @@
+     const QColor accent(13, 13, 13);
+     QPalette palette;
+     palette.setBrush(QPalette::Highlight, highlight);
+-    palette.setBrush(QPalette::AccentColor, accent);
++    palette.setBrush(QPalette::Accent, accent);
+ 
+-    // When saved with Qt_6_5 or earlier, AccentColor defaults to Highlight
++    // When saved with Qt_6_5 or earlier, Accent defaults to Highlight
+     {
+         QByteArray b;
+         {
+@@ -369,10 +369,10 @@
+         QDataStream stream (&b, QIODevice::ReadOnly);
+         stream.setVersion(QDataStream::Qt_6_5);
+         stream >> test;
+-        QCOMPARE(test.accentColor().color(), highlight);
++        QCOMPARE(test.accent().color(), highlight);
+     }
+ 
+-    // When saved with Qt_6_6 or later, AccentColor is saved explicitly
++    // When saved with Qt_6_6 or later, Accent is saved explicitly
+     {
+         QByteArray b;
+         {
+@@ -384,7 +384,7 @@
+         QDataStream stream (&b, QIODevice::ReadOnly);
+         stream.setVersion(QDataStream::Qt_6_6);
+         stream >> test;
+-        QCOMPARE(test.accentColor().color(), accent);
++        QCOMPARE(test.accent().color(), accent);
+     }
+ }
+ 
+diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
+index 778c4a0..bb6ed1d 100644
+--- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
++++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
+@@ -1548,9 +1548,9 @@
+     QBrush selectedBackground;
+     QBrush alternateBackground;
+     QBrush placeHolderTextForeground;
+-    QBrush accentColor;
++    QBrush accent;
+     QVERIFY(ve.extractPalette(&foreground, &selectedForeground, &selectedBackground,
+-                              &alternateBackground, &placeHolderTextForeground, &accentColor));
++                              &alternateBackground, &placeHolderTextForeground, &accent));
+ 
+     if (type == "linear") {
+         QCOMPARE(selectedBackground.style(), Qt::LinearGradientPattern);
+diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+index ef26351..55050e2 100644
+--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
++++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+@@ -106,7 +106,7 @@
+     void QTBUG36933_brokenPseudoClassLookup();
+     void styleSheetChangeBeforePolish();
+     void placeholderColor();
+-    void accentColor();
++    void accent();
+     void enumPropertySelector_data();
+     void enumPropertySelector();
+     //at the end because it mess with the style.
+@@ -2363,13 +2363,13 @@
+     QCOMPARE(le1.palette().placeholderText().color(), QColor(phSpec));
+ }
+ 
+-void tst_QStyleSheetStyle::accentColor()
++void tst_QStyleSheetStyle::accent()
+ {
+     QLineEdit lineEdit;
+     const QColor universe(42, 42, 42);
+     lineEdit.setStyleSheet(QString("QLineEdit { accent-color: %1; }").arg(universe.name()));
+     lineEdit.ensurePolished();
+-    QCOMPARE(lineEdit.palette().accentColor().color(), universe);
++    QCOMPARE(lineEdit.palette().accent().color(), universe);
+ }
+ 
+ void tst_QStyleSheetStyle::enumPropertySelector_data()
diff --git a/debian/patches/series b/debian/patches/series
index d925b80..da70b36 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,5 @@ build_path_embedded_qtbuildinternalsextra_cmake.patch
 # Don't use yield on CPUs that might not support it
 armel-noyield.patch
 
+#Temp upstream patch to fix qpallet
+4781de5.diff


More information about the Neon-commits mailing list