summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/QtPrecompiledHeadersHelpers.cmake12
-rw-r--r--src/corelib/doc/src/cmake/cmake-configure-variables.qdoc4
-rw-r--r--src/plugins/styles/modernwindows/qwindows11style.cpp17
-rw-r--r--src/plugins/styles/modernwindows/qwindows11style_p.h3
4 files changed, 24 insertions, 12 deletions
diff --git a/cmake/QtPrecompiledHeadersHelpers.cmake b/cmake/QtPrecompiledHeadersHelpers.cmake
index b47e4e74e33..7fe94664da3 100644
--- a/cmake/QtPrecompiledHeadersHelpers.cmake
+++ b/cmake/QtPrecompiledHeadersHelpers.cmake
@@ -14,6 +14,18 @@ function(qt_update_precompiled_header_with_library target library)
get_target_property(target_type "${library}" TYPE)
if(target_type STREQUAL "INTERFACE_LIBRARY")
+ # If target links against QtFooPrivate then QtFoo is transitively pulled
+ # in. We assume that headers from QtFoo will be used and add this
+ # library to the target's precompiled headers too.
+ get_target_property(is_private_module "${library}" _qt_is_private_module)
+ if(is_private_module)
+ get_target_property(public_module_target "${library}" _qt_public_module_target_name)
+ qt_update_precompiled_header_with_library("${target}"
+ "${QT_CMAKE_EXPORT_NAMESPACE}::${public_module_target}"
+ )
+ endif()
+
+ # Don't handle interface libraries any further.
return()
endif()
diff --git a/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc b/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc
index 42cb3ecb42b..b8e5e038a33 100644
--- a/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc
+++ b/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc
@@ -142,6 +142,10 @@ effectively disables release package signing even in Release or RelWithDebInfo
builds. When not set, the default behavior is to use release package signing in
build types other than Debug.
+This variable is not supposed to be set in CMake project files. Rather set it
+when configuring your project on the command line or in the CMake settings of
+your IDE.
+
\sa {androiddeployqt}
*/
diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp
index ff2d4bd845f..e9b90d787bc 100644
--- a/src/plugins/styles/modernwindows/qwindows11style.cpp
+++ b/src/plugins/styles/modernwindows/qwindows11style.cpp
@@ -596,7 +596,7 @@ void QWindows11Style::drawComplexControl(ComplexControl control, const QStyleOpt
if (sub & SC_ComboBoxArrow) {
QRectF rect = proxy()->subControlRect(CC_ComboBox, option, SC_ComboBoxArrow, widget);
painter->setFont(d->assetFont);
- painter->setPen(controlTextColor(option));
+ painter->setPen(controlTextColor(option, true));
painter->drawText(rect, Qt::AlignCenter, fluentIcon(Icon::ChevronDownMed));
}
if (state & State_KeyboardFocusChange && hasFocus) {
@@ -887,7 +887,7 @@ void QWindows11Style::drawPrimitive(PrimitiveElement element, const QStyleOption
if (isOn) {
painter->setFont(d->assetFont);
- painter->setPen(controlTextColor(option, QPalette::Window));
+ painter->setPen(controlTextColor(option));
qreal clipWidth = 1.0;
const QString str = fluentIcon(Icon::AcceptMedium);
QFontMetrics fm(d->assetFont);
@@ -907,7 +907,7 @@ void QWindows11Style::drawPrimitive(PrimitiveElement element, const QStyleOption
QFont f(d->assetFont);
f.setPointSize(6);
painter->setFont(f);
- painter->setPen(controlTextColor(option, QPalette::Window));
+ painter->setPen(controlTextColor(option));
painter->drawText(rect, Qt::AlignCenter, fluentIcon(Icon::Dash12));
}
}
@@ -1214,7 +1214,7 @@ void QWindows11Style::drawControl(ControlElement element, const QStyleOption *op
case QStyle::CE_ComboBoxLabel:
#if QT_CONFIG(combobox)
if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
- painter->setPen(controlTextColor(option));
+ painter->setPen(controlTextColor(option, true));
QStyleOptionComboBox newOption = *cb;
newOption.rect.adjust(4,0,-4,0);
QCommonStyle::drawControl(element, &newOption, painter, widget);
@@ -2737,7 +2737,7 @@ QBrush QWindows11Style::inputFillBrush(const QStyleOption *option, const QWidget
return winUI3Color(fillControlDefault);
}
-QColor QWindows11Style::controlTextColor(const QStyleOption *option, QPalette::ColorRole role) const
+QColor QWindows11Style::controlTextColor(const QStyleOption *option, bool ignoreIsChecked) const
{
using namespace StyleOptionHelper;
static constexpr WINUI3Color colorEnums[2][4] = {
@@ -2750,12 +2750,9 @@ QColor QWindows11Style::controlTextColor(const QStyleOption *option, QPalette::C
if (option->palette.isBrushSet(QPalette::Current, QPalette::ButtonText))
return option->palette.buttonText().color();
- const int colorIndex = isChecked(option) ? 1 : 0;
+ const int colorIndex = !ignoreIsChecked && isChecked(option) ? 1 : 0;
const auto state = calcControlState(option);
- const auto alpha = winUI3Color(colorEnums[colorIndex][int(state)]);
- QColor col = option->palette.color(role);
- col.setAlpha(alpha.alpha());
- return col;
+ return winUI3Color(colorEnums[colorIndex][int(state)]);
}
void QWindows11Style::drawLineEditFrame(QPainter *p, const QRectF &rect, const QStyleOption *o, bool isEditable) const
diff --git a/src/plugins/styles/modernwindows/qwindows11style_p.h b/src/plugins/styles/modernwindows/qwindows11style_p.h
index 96c2c4136e0..9d0cdda3e33 100644
--- a/src/plugins/styles/modernwindows/qwindows11style_p.h
+++ b/src/plugins/styles/modernwindows/qwindows11style_p.h
@@ -104,8 +104,7 @@ private:
QBrush controlFillBrush(const QStyleOption *option, ControlType controlType) const;
QBrush inputFillBrush(const QStyleOption *option, const QWidget *widget) const;
// ControlType::ControlAlt can be mapped to QPalette directly
- QColor controlTextColor(const QStyleOption *option,
- QPalette::ColorRole role = QPalette::ButtonText) const;
+ QColor controlTextColor(const QStyleOption *option, bool ignoreIsChecked = false) const;
void drawLineEditFrame(QPainter *p, const QRectF &rect, const QStyleOption *o, bool isEditable = true) const;
inline QColor winUI3Color(enum WINUI3Color col) const;