From 678e0116420ff735caa7b34d129302b85f80554b Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 3 Jul 2022 18:11:56 +0200 Subject: [PATCH] Fix QTBUG-92199 by reverting 5a9bcf5 --- .dockerignore | 3 ++- Dockerfile.linux | 5 +++- contrib/QTBUG-92199-fix.patch | 46 +++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 contrib/QTBUG-92199-fix.patch diff --git a/.dockerignore b/.dockerignore index 709533e..f1c4e0f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ * -!contrib/build-deps/verify-packages.sh \ No newline at end of file +!contrib/build-deps/verify-packages.sh +!contrib/QTBUG-92199-fix.patch \ No newline at end of file diff --git a/Dockerfile.linux b/Dockerfile.linux index 8d00f4e..65c5b81 100644 --- a/Dockerfile.linux +++ b/Dockerfile.linux @@ -73,6 +73,8 @@ RUN git clone -b 2.13.92 --depth 1 https://gitlab.freedesktop.org/fontconfig/fon make -j$THREADS install && \ rm -rf $(pwd) +COPY contrib/QTBUG-92199-fix.patch . + ENV QT_VERSION=v5.15.5-lts-lgpl RUN git clone git://code.qt.io/qt/qt5.git -b ${QT_VERSION} --depth 1 && \ cd qt5 && \ @@ -86,7 +88,8 @@ RUN git clone git://code.qt.io/qt/qt5.git -b ${QT_VERSION} --depth 1 && \ git clone git://code.qt.io/qt/qtwebsockets.git -b ${QT_VERSION} --depth 1 && \ sed -ri s/\(Libs:.*\)/\\1\ -lexpat/ /usr/local/lib/pkgconfig/fontconfig.pc && \ sed -ri s/\(Libs:.*\)/\\1\ -lz/ /usr/local/lib/pkgconfig/freetype2.pc && \ - sed -i s/\\/usr\\/X11R6\\/lib64/\\/usr\\/local\\/lib/ qtbase/mkspecs/linux-g++-64/qmake.conf + sed -i s/\\/usr\\/X11R6\\/lib64/\\/usr\\/local\\/lib/ qtbase/mkspecs/linux-g++-64/qmake.conf && \ + cd qtbase && cat ../../QTBUG-92199-fix.patch && git apply ../../QTBUG-92199-fix.patch RUN cd qt5 && \ if [ "$(uname -m)" = "aarch64" ]; then \ diff --git a/contrib/QTBUG-92199-fix.patch b/contrib/QTBUG-92199-fix.patch new file mode 100644 index 0000000..6be407a --- /dev/null +++ b/contrib/QTBUG-92199-fix.patch @@ -0,0 +1,46 @@ +diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp +index 2ab9756f8d..a9d6ecd51a 100644 +--- a/src/widgets/styles/qstylesheetstyle.cpp ++++ b/src/widgets/styles/qstylesheetstyle.cpp +@@ -1465,7 +1465,6 @@ void QRenderRule::configurePalette(QPalette *p, QPalette::ColorGroup cg, const Q + p->setBrush(cg, w->foregroundRole(), pal->foreground); + p->setBrush(cg, QPalette::WindowText, pal->foreground); + p->setBrush(cg, QPalette::Text, pal->foreground); +- p->setBrush(cg, QPalette::PlaceholderText, pal->foreground); + } + if (pal->selectionBackground.style() != Qt::NoBrush) + p->setBrush(cg, QPalette::Highlight, pal->selectionBackground); +diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp +index 26868a763c..82527849b0 100644 +--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp ++++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp +@@ -126,7 +126,6 @@ private slots: + void QTBUG15910_crashNullWidget(); + void QTBUG36933_brokenPseudoClassLookup(); + void styleSheetChangeBeforePolish(); +- void placeholderColor(); + //at the end because it mess with the style. + void widgetStyle(); + void appStyle(); +@@ -2230,21 +2229,6 @@ void tst_QStyleSheetStyle::highdpiImages() + QHighDpiScaling::updateHighDpiScaling(); // reset to normal + } + +-void tst_QStyleSheetStyle::placeholderColor() +-{ +- const QColor red(Qt::red); +- qApp->setStyleSheet("* { color: red; }"); +- QLineEdit le1; +- QLineEdit le2; +- le2.setEnabled(false); +- le1.ensurePolished(); +- QCOMPARE(le1.palette().placeholderText(), red); +- le2.ensurePolished(); +- QCOMPARE(le2.palette().placeholderText(), red); +- le2.setEnabled(true); +- QCOMPARE(le2.palette().placeholderText(), red); +-} +- + QTEST_MAIN(tst_QStyleSheetStyle) + #include "tst_qstylesheetstyle.moc" +