summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Ehrlicher <[email protected]>2025-04-29 20:55:30 +0200
committerChristian Ehrlicher <[email protected]>2025-05-01 02:45:02 +0200
commite57fff63419867d59b6067fc1a5a3495678708dc (patch)
tree48e1d9e7f59fa316253e3133fdee634969ee68f1
parenta1612886bade6192fecad33d0dacb1d24792e315 (diff)
Widgets/Stylesheets: compile without FEATURE_style_stylesheet
Make sure to not compile the stylesheet sources when FEATURE_style_stylesheet is disabled, also don't include the relevant headers in this case. Pick-to: 6.9 Fixes: QTBUG-136341 Change-Id: I4fc2de2fcba004b93140809ef79374401209f14a Reviewed-by: Axel Spoerl <[email protected]>
-rw-r--r--src/widgets/CMakeLists.txt8
-rw-r--r--src/widgets/kernel/qapplication.cpp2
-rw-r--r--src/widgets/kernel/qtooltip.cpp2
-rw-r--r--src/widgets/kernel/qwidget.cpp2
-rw-r--r--src/widgets/widgets/qdockwidget.cpp1
-rw-r--r--src/widgets/widgets/qlabel.cpp4
-rw-r--r--src/widgets/widgets/qlineedit.cpp3
7 files changed, 17 insertions, 5 deletions
diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt
index b77339b40f9..631bc3f59ee 100644
--- a/src/widgets/CMakeLists.txt
+++ b/src/widgets/CMakeLists.txt
@@ -43,8 +43,6 @@ qt_internal_add_module(Widgets
styles/qstyleoption.cpp styles/qstyleoption.h
styles/qstylepainter.cpp styles/qstylepainter.h
styles/qstyleplugin.cpp styles/qstyleplugin.h
- styles/qstylesheetstyle.cpp styles/qstylesheetstyle_p.h
- styles/qstylesheetstyle_default.cpp
util/qcolormap.cpp util/qcolormap.h
util/qsystemtrayicon.cpp util/qsystemtrayicon.h util/qsystemtrayicon_p.h
widgets/qabstractscrollarea.cpp widgets/qabstractscrollarea.h widgets/qabstractscrollarea_p.h
@@ -425,6 +423,12 @@ qt_internal_extend_target(Widgets CONDITION QT_FEATURE_animation
styles/qstyleanimation.cpp styles/qstyleanimation_p.h
)
+qt_internal_extend_target(Widgets CONDITION QT_FEATURE_style_stylesheet
+ SOURCES
+ styles/qstylesheetstyle.cpp styles/qstylesheetstyle_p.h
+ styles/qstylesheetstyle_default.cpp
+)
+
qt_internal_extend_target(Widgets CONDITION QT_FEATURE_style_windows
SOURCES
styles/qwindowsstyle.cpp styles/qwindowsstyle_p.h
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index db88c85990e..c01ae29c680 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -33,7 +33,9 @@
#include "private/qguiapplication_p.h"
#include "qcolormap.h"
#include "qdebug.h"
+#if QT_CONFIG(style_stylesheet)
#include "private/qstylesheetstyle_p.h"
+#endif
#include "private/qstyle_p.h"
#if QT_CONFIG(messagebox)
#include "qmessagebox.h"
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index 263af37b1a8..12ba8ae545b 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -16,7 +16,9 @@
#include <qdebug.h>
#include <qpa/qplatformscreen.h>
#include <qpa/qplatformcursor.h>
+#if QT_CONFIG(style_stylesheet)
#include <private/qstylesheetstyle_p.h>
+#endif
#include <qlabel.h>
#include <QtWidgets/private/qlabel_p.h>
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 3d05dca4629..f36d7f094dd 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -36,7 +36,9 @@
#include "qwhatsthis.h"
#endif
#include "qdebug.h"
+#if QT_CONFIG(style_stylesheet)
#include "private/qstylesheetstyle_p.h"
+#endif
#include "private/qstyle_p.h"
#include "qfileinfo.h"
#include "qscopeguard.h"
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp
index 4387b7626a7..33e9c8f3e88 100644
--- a/src/widgets/widgets/qdockwidget.cpp
+++ b/src/widgets/widgets/qdockwidget.cpp
@@ -17,7 +17,6 @@
#include <qdebug.h>
#include <private/qwidgetresizehandler_p.h>
-#include <private/qstylesheetstyle_p.h>
#include <qpa/qplatformtheme.h>
#include <private/qhighdpiscaling_p.h>
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index d243a671da5..a71faa77782 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -8,9 +8,11 @@
#include "qstyleoption.h"
#include "qlabel_p.h"
#include "private/qhexstring_p.h"
-#include "private/qstylesheetstyle_p.h"
#include <qmath.h>
+#if QT_CONFIG(style_stylesheet)
+#include "private/qstylesheetstyle_p.h"
+#endif
#if QT_CONFIG(abstractbutton)
#include "qabstractbutton.h"
#endif
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index 5b483301688..2f68ad5d4d5 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -41,8 +41,9 @@
#if QT_CONFIG(itemviews)
#include "qabstractitemview.h"
#endif
+#if QT_CONFIG(style_stylesheet)
#include "private/qstylesheetstyle_p.h"
-
+#endif
#if QT_CONFIG(shortcut)
#include "private/qapplication_p.h"
#include "private/qshortcutmap_p.h"