diff options
Diffstat (limited to 'src')
23 files changed, 216 insertions, 94 deletions
diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index 6a83e947146..be362ba1925 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -106,6 +106,27 @@ function(qt6_add_android_dynamic_features target) endif() endfunction() + +function(qt_add_android_dynamic_feature_java_source_dirs) + qt6_add_android_dynamic_feature_java_source_dirs(${ARGV}) +endfunction() + +# Add java source directories for dynamic feature. Intermediate solution until java library +# support exists. +function(qt6_add_android_dynamic_feature_java_source_dirs target) + + set(opt_args "") + set(single_args "") + set(multi_args + SOURCE_DIRS + ) + cmake_parse_arguments(PARSE_ARGV 1 arg "${opt_args}" "${single_args}" "${multi_args}") + if(arg_SOURCE_DIRS) + set_property(TARGET ${target} APPEND PROPERTY + _qt_android_gradle_java_source_dirs ${arg_SOURCE_DIRS}) + endif() +endfunction() + # Generate the deployment settings json file for a cmake target. function(qt6_android_generate_deployment_settings target) # Information extracted from mkspecs/features/android/android_deployment_settings.prf diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index edcfba0f6ce..08908082991 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -31,7 +31,10 @@ qt_find_package_extend_sbom(TARGETS GLIB2::GLIB2 LICENSE_EXPRESSION "LGPL-2.1-or-later" ) qt_find_package(ICU 50.1 COMPONENTS i18n uc data PROVIDED_TARGETS ICU::i18n ICU::uc ICU::data - MODULE_NAME core QMAKE_LIB icu) + MODULE_NAME core QMAKE_LIB icu + VCPKG_PORT icu + VCPKG_PLATFORM !windows +) if(QT_FEATURE_dlopen) qt_add_qmake_lib_dependency(icu libdl) @@ -49,7 +52,9 @@ qt_find_package_extend_sbom(TARGETS Libb2::Libb2 qt_find_package(WrapRt MODULE PROVIDED_TARGETS WrapRt::WrapRt MODULE_NAME core QMAKE_LIB librt) qt_find_package(WrapSystemPCRE2 10.20 MODULE - PROVIDED_TARGETS WrapSystemPCRE2::WrapSystemPCRE2 MODULE_NAME core QMAKE_LIB pcre2) + PROVIDED_TARGETS WrapSystemPCRE2::WrapSystemPCRE2 MODULE_NAME core QMAKE_LIB pcre2 + VCPKG_PORT pcre2 +) set_package_properties(WrapPCRE2 PROPERTIES TYPE REQUIRED) if((QNX) OR QT_FIND_ALL_PACKAGES_ALWAYS) qt_find_package(PPS MODULE PROVIDED_TARGETS PPS::PPS MODULE_NAME core QMAKE_LIB pps) diff --git a/src/corelib/doc/src/cmake/qt_add_android_dynamic_feature_java_source_dirs.qdoc b/src/corelib/doc/src/cmake/qt_add_android_dynamic_feature_java_source_dirs.qdoc new file mode 100644 index 00000000000..cf670110cab --- /dev/null +++ b/src/corelib/doc/src/cmake/qt_add_android_dynamic_feature_java_source_dirs.qdoc @@ -0,0 +1,30 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! +\page qt_add_android_dynamic_feature_java_source_dirs.html +\ingroup cmake-commands-qtcore + +\title qt_add_android_dynamic_feature_java_source_dirs +\keyword qt6_add_android_dynamic_feature_java_source_dirs + +\summary {Adds Java source directories to a dynamic feature build.} + +\include cmake-find-package-core.qdocinc + +\cmakecommandsince 6.11 + +\section1 Synopsis + +\badcode +qt_add_android_dynamic_feature_java_source_dirs(target [SOURCE_DIRS <directory1> <directory2> ...]) +\endcode + +\versionlessCMakeCommandsNote qt6_add_android_dynamic_feature_java_source_dirs() + +\section1 Description + +The command adds extra Java/Kotlin source directories to the \c {target} +executable when building the executable app with dynamic feature functionality. +To be used in conjunction with qt6_add_android_dynamic_features(). +*/ diff --git a/src/corelib/itemmodels/qrangemodel_impl.h b/src/corelib/itemmodels/qrangemodel_impl.h index 70552cbfe05..88bd6cf444e 100644 --- a/src/corelib/itemmodels/qrangemodel_impl.h +++ b/src/corelib/itemmodels/qrangemodel_impl.h @@ -28,7 +28,7 @@ #include <functional> #include <iterator> #include <type_traits> -#include <QtCore/q20type_traits.h> +#include <QtCore/qxptype_traits.h> #include <tuple> #include <QtCore/q23utility.h> @@ -562,35 +562,30 @@ namespace QRangeModelDetails } }; - template <typename P, typename R, typename = void> - struct protocol_parentRow : std::false_type {}; template <typename P, typename R> - struct protocol_parentRow<P, R, - std::void_t<decltype(std::declval<P&>().parentRow(std::declval<wrapped_t<R>&>()))>> - : std::true_type {}; + using protocol_parentRow_test = decltype(std::declval<P&>() + .parentRow(std::declval<QRangeModelDetails::wrapped_t<R>&>())); + template <typename P, typename R> + using protocol_parentRow = qxp::is_detected<protocol_parentRow_test, P, R>; - template <typename P, typename R, typename = void> - struct protocol_childRows : std::false_type {}; template <typename P, typename R> - struct protocol_childRows<P, R, - std::void_t<decltype(std::declval<P&>().childRows(std::declval<wrapped_t<R>&>()))>> - : std::true_type {}; + using protocol_childRows_test = decltype(std::declval<P&>() + .childRows(std::declval<QRangeModelDetails::wrapped_t<R>&>())); + template <typename P, typename R> + using protocol_childRows = qxp::is_detected<protocol_childRows_test, P, R>; - template <typename P, typename R, typename = void> - struct protocol_setParentRow : std::false_type {}; template <typename P, typename R> - struct protocol_setParentRow<P, R, - std::void_t<decltype(std::declval<P&>().setParentRow(std::declval<wrapped_t<R>&>(), - std::declval<wrapped_t<R>*>()))>> - : std::true_type {}; + using protocol_setParentRow_test = decltype(std::declval<P&>() + .setParentRow(std::declval<QRangeModelDetails::wrapped_t<R>&>(), + std::declval<QRangeModelDetails::wrapped_t<R>*>())); + template <typename P, typename R> + using protocol_setParentRow = qxp::is_detected<protocol_setParentRow_test, P, R>; - template <typename P, typename R, typename = void> - struct protocol_mutable_childRows : std::false_type {}; template <typename P, typename R> - struct protocol_mutable_childRows<P, R, - std::void_t<decltype(refTo(std::declval<P&>().childRows(std::declval<wrapped_t<R>&>())) - = {}) >> - : std::true_type {}; + using protocol_mutable_childRows_test = decltype(refTo(std::declval<P&>() + .childRows(std::declval<wrapped_t<R>&>())) = {}); + template <typename P, typename R> + using protocol_mutable_childRows = qxp::is_detected<protocol_mutable_childRows_test, P, R>; template <typename P, typename = void> struct protocol_newRow : std::false_type {}; diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 02c9f00f301..607dc23f56c 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -2696,23 +2696,38 @@ static void err_method_notfound(const QObject *object, case QSIGNAL_CODE: type = "signal"; break; } const char *loc = extract_location(method); + const char *err; if (strchr(method, ')') == nullptr) // common typing mistake - qCWarning(lcConnect, "QObject::%s: Parentheses expected, %s %s::%s%s%s", func, type, - object->metaObject()->className(), method + 1, loc ? " in " : "", loc ? loc : ""); + err = "Parentheses expected,"; else - qCWarning(lcConnect, "QObject::%s: No such %s %s::%s%s%s", func, type, - object->metaObject()->className(), method + 1, loc ? " in " : "", loc ? loc : ""); + err = "No such"; + qCWarning(lcConnect, "QObject::%s: %s %s %s::%s%s%s", func, err, type, + object->metaObject()->className(), method + 1, loc ? " in " : "", loc ? loc : ""); +} + +enum class ConnectionEnd : bool { Sender, Receiver }; +Q_DECL_COLD_FUNCTION +static void err_info_about_object(const char *func, const QObject *o, ConnectionEnd end) +{ + if (!o) + return; + const QString name = o->objectName(); + if (name.isEmpty()) + return; + const bool sender = end == ConnectionEnd::Sender; + qCWarning(lcConnect, "QObject::%s: (%s name:%*s'%ls')", + func, + sender ? "sender" : "receiver", + sender ? 3 : 1, // ← length of generated whitespace + "", + qUtf16Printable(name)); } Q_DECL_COLD_FUNCTION static void err_info_about_objects(const char *func, const QObject *sender, const QObject *receiver) { - QString a = sender ? sender->objectName() : QString(); - QString b = receiver ? receiver->objectName() : QString(); - if (!a.isEmpty()) - qCWarning(lcConnect, "QObject::%s: (sender name: '%s')", func, a.toLocal8Bit().data()); - if (!b.isEmpty()) - qCWarning(lcConnect, "QObject::%s: (receiver name: '%s')", func, b.toLocal8Bit().data()); + err_info_about_object(func, sender, ConnectionEnd::Sender); + err_info_about_object(func, receiver, ConnectionEnd::Receiver); } Q_DECL_COLD_FUNCTION diff --git a/src/gui/accessible/linux/qspimatchrulematcher.cpp b/src/gui/accessible/linux/qspimatchrulematcher.cpp index 1c8f17ac335..48357f7ae63 100644 --- a/src/gui/accessible/linux/qspimatchrulematcher.cpp +++ b/src/gui/accessible/linux/qspimatchrulematcher.cpp @@ -24,8 +24,9 @@ QSpiMatchRuleMatcher::QSpiMatchRuleMatcher(const QSpiMatchRule &matchRule) { // extract roles encoded in bitset stored in multiple 32 bit integers for (qsizetype i = 0; i < matchRule.roles.size(); ++i) { + const auto role = matchRule.roles.at(i); for (int j = 0; j < 32; j++) { - if (matchRule.roles.at(i) & (1 << j)) { + if (role & (1 << j)) { const auto atspiRole = i * 32 + j; if (atspiRole < ATSPI_ROLE_LAST_DEFINED) m_roles.insert(AtspiRole(atspiRole)); @@ -37,6 +38,7 @@ QSpiMatchRuleMatcher::QSpiMatchRuleMatcher(const QSpiMatchRule &matchRule) } // use qualified interface names to match what accessibleInterfaces() returns + m_interfaces.reserve(matchRule.interfaces.size()); for (const QString &ifaceName : matchRule.interfaces) m_interfaces.push_back("org.a11y.atspi."_L1 + ifaceName); } diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index dac2d072e42..b14f7e74ad2 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -30,6 +30,7 @@ set_property(CACHE INPUT_libpng PROPERTY STRINGS undefined no qt system) #### Libraries qt_set01(X11_SUPPORTED LINUX OR HPUX OR FREEBSD OR NETBSD OR OPENBSD OR SOLARIS OR HURD) +qt_feature_vcpkg_scope(gui) qt_find_package(ATSPI2 MODULE PROVIDED_TARGETS PkgConfig::ATSPI2 MODULE_NAME gui QMAKE_LIB atspi) qt_find_package(DirectFB PROVIDED_TARGETS PkgConfig::DirectFB MODULE_NAME gui QMAKE_LIB directfb) qt_find_package(Libdrm MODULE PROVIDED_TARGETS Libdrm::Libdrm MODULE_NAME gui QMAKE_LIB drm) @@ -39,15 +40,26 @@ qt_find_package(PlatformGraphics qt_find_package(EGL MODULE PROVIDED_TARGETS EGL::EGL MODULE_NAME gui QMAKE_LIB egl) qt_find_package(WrapSystemFreetype 2.2.0 MODULE - PROVIDED_TARGETS WrapSystemFreetype::WrapSystemFreetype MODULE_NAME gui QMAKE_LIB freetype) + PROVIDED_TARGETS WrapSystemFreetype::WrapSystemFreetype MODULE_NAME gui QMAKE_LIB freetype + VCPKG_PORT freetype + VCPKG_ADD_TO_FEATURE freetype +) if(QT_FEATURE_system_zlib) qt_add_qmake_lib_dependency(freetype zlib) endif() -qt_find_package(Fontconfig PROVIDED_TARGETS Fontconfig::Fontconfig MODULE_NAME gui QMAKE_LIB fontconfig) +qt_find_package(Fontconfig PROVIDED_TARGETS Fontconfig::Fontconfig MODULE_NAME gui + QMAKE_LIB fontconfig + VCPKG_PORT fontconfig + VCPKG_ADD_TO_FEATURE fontconfig + VCPKG_PLATFORM "linux" +) qt_add_qmake_lib_dependency(fontconfig freetype) qt_find_package(gbm MODULE PROVIDED_TARGETS gbm::gbm MODULE_NAME gui QMAKE_LIB gbm) qt_find_package(WrapSystemHarfbuzz 2.6.0 MODULE - PROVIDED_TARGETS WrapSystemHarfbuzz::WrapSystemHarfbuzz MODULE_NAME gui QMAKE_LIB harfbuzz) + PROVIDED_TARGETS WrapSystemHarfbuzz::WrapSystemHarfbuzz MODULE_NAME gui QMAKE_LIB harfbuzz + VCPKG_PORT harfbuzz + VCPKG_ADD_TO_FEATURE harfbuzz +) qt_find_package(Libinput MODULE PROVIDED_TARGETS Libinput::Libinput MODULE_NAME gui QMAKE_LIB libinput) qt_find_package_extend_sbom(TARGETS Libinput::Libinput @@ -61,11 +73,20 @@ qt_find_package_extend_sbom(TARGETS Libinput::Libinput "Copyright © 2013-2015 Red Hat, Inc." ) qt_find_package(WrapSystemJpeg MODULE - PROVIDED_TARGETS WrapSystemJpeg::WrapSystemJpeg MODULE_NAME gui QMAKE_LIB libjpeg) + PROVIDED_TARGETS WrapSystemJpeg::WrapSystemJpeg MODULE_NAME gui QMAKE_LIB libjpeg + VCPKG_PORT libjpeg-turbo + VCPKG_ADD_TO_FEATURE jpeg +) qt_find_package(WrapSystemMd4c MODULE - PROVIDED_TARGETS WrapSystemMd4c::WrapSystemMd4c MODULE_NAME gui QMAKE_LIB libmd4c) + PROVIDED_TARGETS WrapSystemMd4c::WrapSystemMd4c MODULE_NAME gui QMAKE_LIB libmd4c + VCPKG_PORT md4c + VCPKG_ADD_TO_FEATURE textmarkdownreader +) qt_find_package(WrapSystemPNG MODULE - PROVIDED_TARGETS WrapSystemPNG::WrapSystemPNG MODULE_NAME gui QMAKE_LIB libpng) + PROVIDED_TARGETS WrapSystemPNG::WrapSystemPNG MODULE_NAME gui QMAKE_LIB libpng + VCPKG_PORT libpng + VCPKG_ADD_TO_FEATURE png +) if(QT_FEATURE_system_zlib) qt_add_qmake_lib_dependency(libpng zlib) endif() diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 7ffb688c035..b60cad34a8d 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -1829,6 +1829,8 @@ bool QFont::operator==(const QFont &f) const */ bool QFont::operator<(const QFont &f) const { + // NB: This operator actually implements greater-than, because it consistently + // swaps LHS (should be *this, but is `f`) and RHS (should be `f`, but is *this) if (f.d == d) return false; // the < operator for fontdefs ignores point sizes. const QFontDef &r1 = f.d->request; diff --git a/src/network/configure.cmake b/src/network/configure.cmake index baadf23dbd7..5dd2af418fa 100644 --- a/src/network/configure.cmake +++ b/src/network/configure.cmake @@ -7,8 +7,12 @@ #### Libraries +qt_feature_vcpkg_scope(network) qt_find_package(WrapBrotli MODULE - PROVIDED_TARGETS WrapBrotli::WrapBrotliDec MODULE_NAME network QMAKE_LIB brotli) + PROVIDED_TARGETS WrapBrotli::WrapBrotliDec MODULE_NAME network QMAKE_LIB brotli + VCPKG_PORT brotli + VCPKG_ADD_TO_FEATURE brotli +) qt_find_package(Libproxy MODULE PROVIDED_TARGETS PkgConfig::Libproxy MODULE_NAME network QMAKE_LIB libproxy) qt_find_package(GSSAPI MODULE PROVIDED_TARGETS GSSAPI::GSSAPI MODULE_NAME network QMAKE_LIB gssapi) diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h index 9a491d4d058..35fb7f24dd5 100644 --- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h +++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h @@ -29,7 +29,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(NSStatusItem); QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QCocoaSystemTrayIcon : public QPlatformSystemTrayIcon +class QCocoaSystemTrayIcon : public QPlatformSystemTrayIcon { public: QCocoaSystemTrayIcon() {} diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/dmabuf-server/dmabufserverbufferintegration.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/dmabuf-server/dmabufserverbufferintegration.h index 13dbdfbfbab..ba3d293e054 100644 --- a/src/plugins/platforms/wayland/plugins/hardwareintegration/dmabuf-server/dmabufserverbufferintegration.h +++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/dmabuf-server/dmabufserverbufferintegration.h @@ -9,7 +9,6 @@ #include "qwayland-qt-dmabuf-server-buffer.h" #include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h> -#include "dmabufserverbufferintegration.h" #include <QtWaylandClient/private/qwaylanddisplay_p.h> #include <QtCore/QTextStream> diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/drm-egl-server/drmeglserverbufferintegration.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/drm-egl-server/drmeglserverbufferintegration.h index a06bc96b87d..01ac4dbe718 100644 --- a/src/plugins/platforms/wayland/plugins/hardwareintegration/drm-egl-server/drmeglserverbufferintegration.h +++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/drm-egl-server/drmeglserverbufferintegration.h @@ -9,7 +9,6 @@ #include "qwayland-drm-egl-server-buffer.h" #include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h> -#include "drmeglserverbufferintegration.h" #include <QtWaylandClient/private/qwaylanddisplay_p.h> #include <QtCore/QTextStream> diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/shm-emulation-server/shmserverbufferintegration.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/shm-emulation-server/shmserverbufferintegration.h index 344046ae182..4f9e0aeced5 100644 --- a/src/plugins/platforms/wayland/plugins/hardwareintegration/shm-emulation-server/shmserverbufferintegration.h +++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/shm-emulation-server/shmserverbufferintegration.h @@ -8,7 +8,6 @@ #include "qwayland-shm-emulation-server-buffer.h" #include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h> -#include "shmserverbufferintegration.h" #include <QtWaylandClient/private/qwaylanddisplay_p.h> #include <QtCore/QTextStream> diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/vulkan-server/vulkanserverbufferintegration.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/vulkan-server/vulkanserverbufferintegration.h index 2f0867a8197..a1c413be5d9 100644 --- a/src/plugins/platforms/wayland/plugins/hardwareintegration/vulkan-server/vulkanserverbufferintegration.h +++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/vulkan-server/vulkanserverbufferintegration.h @@ -8,7 +8,6 @@ #include "qwayland-qt-vulkan-server-buffer-unstable-v1.h" #include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h> -#include "vulkanserverbufferintegration.h" #include <QtWaylandClient/private/qwaylanddisplay_p.h> #include <QtCore/QTextStream> diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h index 780f5f3268e..6d86600bad2 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h +++ b/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h @@ -82,8 +82,8 @@ private: friend class QWaylandWindow; }; -QT_END_NAMESPACE +} // namespace QtWaylandClient -} +QT_END_NAMESPACE #endif // QWAYLANDSHELLSURFACE_H diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgactivationv1_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgactivationv1_p.h index bddb5c614e0..e2c54ef0078 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgactivationv1_p.h +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgactivationv1_p.h @@ -52,8 +52,7 @@ public: const QString &app_id); }; -QT_END_NAMESPACE - -} +} // namespace QtWaylandClient +QT_END_NAMESPACE #endif // QWAYLANDXDGACTIVATIONV1_P_H diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdecorationv1_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdecorationv1_p.h index 8a0cc9e79a7..680fcf69b9f 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdecorationv1_p.h +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdecorationv1_p.h @@ -56,8 +56,7 @@ private: bool m_configured = false; }; -QT_END_NAMESPACE - -} +} // namespace QtWaylandClient +QT_END_NAMESPACE #endif // QWAYLANDXDGDECORATIONV1_P_H diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h index a12311eff74..43c17672c23 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h @@ -201,8 +201,7 @@ private: friend class QWaylandXdgSurface; }; -QT_END_NAMESPACE - -} +} // namespace QtWaylandClient +QT_END_NAMESPACE #endif // QWAYLANDXDGSHELL_H diff --git a/src/plugins/platforms/windows/qwindowswindowclassregistry.cpp b/src/plugins/platforms/windows/qwindowswindowclassregistry.cpp index 19694eab330..8bf2fb887f1 100644 --- a/src/plugins/platforms/windows/qwindowswindowclassregistry.cpp +++ b/src/plugins/platforms/windows/qwindowswindowclassregistry.cpp @@ -18,8 +18,8 @@ Q_LOGGING_CATEGORY(lcQpaWindowClass, "qt.qpa.windowclass") QWindowsWindowClassRegistry *QWindowsWindowClassRegistry::m_instance = nullptr; -QWindowsWindowClassRegistry::QWindowsWindowClassRegistry(WNDPROC proc) - : m_proc(proc) +QWindowsWindowClassRegistry::QWindowsWindowClassRegistry(WNDPROC defaultProcedure) + : m_defaultProcedure(defaultProcedure) { m_instance = this; } @@ -69,25 +69,19 @@ QString QWindowsWindowClassRegistry::registerWindowClass(const QWindowsWindowCla // add a UUID. The check needs to be performed for each name // in case new message windows are added (QTBUG-81347). // Note: GetClassInfo() returns != 0 when a class exists. - const auto appInstance = static_cast<HINSTANCE>(GetModuleHandle(nullptr)); - WNDCLASS wcinfo; - const bool classExists = GetClassInfo(appInstance, reinterpret_cast<LPCWSTR>(className.utf16()), &wcinfo) != FALSE - && wcinfo.lpfnWndProc != description.procedure; - - if (classExists) + if (shouldDecorateWindowClassName(description)) className += QUuid::createUuid().toString(); if (m_registeredWindowClassNames.contains(className)) // already registered in our list return className; - WNDCLASSEX wc; + const auto appInstance = static_cast<HINSTANCE>(GetModuleHandle(nullptr)); + + WNDCLASSEX wc{}; wc.cbSize = sizeof(WNDCLASSEX); wc.style = description.style; wc.lpfnWndProc = description.procedure; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; wc.hInstance = appInstance; - wc.hCursor = nullptr; wc.hbrBackground = description.brush; if (description.hasIcon) { wc.hIcon = static_cast<HICON>(LoadImage(appInstance, L"IDI_ICON1", IMAGE_ICON, 0, 0, LR_DEFAULTSIZE)); @@ -98,15 +92,9 @@ QString QWindowsWindowClassRegistry::registerWindowClass(const QWindowsWindowCla } else { wc.hIcon = static_cast<HICON>(LoadImage(nullptr, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_SHARED)); - wc.hIconSm = nullptr; } } - else { - wc.hIcon = nullptr; - wc.hIconSm = nullptr; - } - wc.lpszMenuName = nullptr; wc.lpszClassName = reinterpret_cast<LPCWSTR>(className.utf16()); ATOM atom = RegisterClassEx(&wc); if (!atom) @@ -122,7 +110,7 @@ QString QWindowsWindowClassRegistry::registerWindowClass(const QWindowsWindowCla QString QWindowsWindowClassRegistry::registerWindowClass(const QWindow *window) { - return registerWindowClass(QWindowsWindowClassDescription::fromWindow(window, m_proc)); + return registerWindowClass(QWindowsWindowClassDescription::fromWindow(window, m_defaultProcedure)); } QString QWindowsWindowClassRegistry::registerWindowClass(QString name, WNDPROC procedure) @@ -130,6 +118,21 @@ QString QWindowsWindowClassRegistry::registerWindowClass(QString name, WNDPROC p return registerWindowClass(QWindowsWindowClassDescription::fromName(name, procedure)); } +bool QWindowsWindowClassRegistry::shouldDecorateWindowClassName(const QWindowsWindowClassDescription &description) const +{ + return shouldDecorateWindowClassName(description.name, description.procedure); +} + +bool QWindowsWindowClassRegistry::shouldDecorateWindowClassName(const QString &name, WNDPROC procedure) const +{ + const auto appInstance = static_cast<HINSTANCE>(GetModuleHandle(nullptr)); + + WNDCLASS wc{}; + + return GetClassInfo(appInstance, reinterpret_cast<LPCWSTR>(name.utf16()), &wc) != FALSE + && wc.lpfnWndProc != procedure; +} + void QWindowsWindowClassRegistry::unregisterWindowClasses() { const auto appInstance = static_cast<HINSTANCE>(GetModuleHandle(nullptr)); diff --git a/src/plugins/platforms/windows/qwindowswindowclassregistry.h b/src/plugins/platforms/windows/qwindowswindowclassregistry.h index c19b4f616fb..c4a36b7f3c4 100644 --- a/src/plugins/platforms/windows/qwindowswindowclassregistry.h +++ b/src/plugins/platforms/windows/qwindowswindowclassregistry.h @@ -22,7 +22,7 @@ class QWindowsWindowClassRegistry { Q_DISABLE_COPY_MOVE(QWindowsWindowClassRegistry) public: - QWindowsWindowClassRegistry(WNDPROC proc); + QWindowsWindowClassRegistry(WNDPROC defaultProcedure); ~QWindowsWindowClassRegistry(); static QWindowsWindowClassRegistry *instance(); @@ -34,11 +34,13 @@ public: private: static QString classNamePrefix(); + bool shouldDecorateWindowClassName(const QWindowsWindowClassDescription &description) const; + bool shouldDecorateWindowClassName(const QString &name, WNDPROC procedure) const; void unregisterWindowClasses(); static QWindowsWindowClassRegistry *m_instance; - WNDPROC m_proc; + WNDPROC m_defaultProcedure; QSet<QString> m_registeredWindowClassNames; }; diff --git a/src/plugins/sqldrivers/configure.cmake b/src/plugins/sqldrivers/configure.cmake index d96c220d70a..d12917f5631 100644 --- a/src/plugins/sqldrivers/configure.cmake +++ b/src/plugins/sqldrivers/configure.cmake @@ -13,12 +13,22 @@ set_property(CACHE INPUT_sqlite PROPERTY STRINGS undefined qt system) #### Libraries +qt_feature_vcpkg_scope(sql) qt_find_package(DB2 MODULE PROVIDED_TARGETS DB2::DB2 MODULE_NAME sqldrivers QMAKE_LIB db2) -qt_find_package(MySQL MODULE PROVIDED_TARGETS MySQL::MySQL MODULE_NAME sqldrivers QMAKE_LIB mysql) -qt_find_package(PostgreSQL MODULE PROVIDED_TARGETS PostgreSQL::PostgreSQL MODULE_NAME sqldrivers QMAKE_LIB psql) +qt_find_package(MySQL MODULE PROVIDED_TARGETS MySQL::MySQL MODULE_NAME sqldrivers QMAKE_LIB mysql + VCPKG_PORT libmysql + VCPKG_ADD_TO_FEATURE sql-mysql +) +qt_find_package(PostgreSQL MODULE PROVIDED_TARGETS PostgreSQL::PostgreSQL MODULE_NAME sqldrivers QMAKE_LIB psql + VCPKG_PORT libpq + VCPKG_ADD_TO_FEATURE sql-psql +) qt_find_package(Oracle MODULE PROVIDED_TARGETS Oracle::OCI MODULE_NAME sqldrivers QMAKE_LIB oci) qt_find_package(ODBC PROVIDED_TARGETS ODBC::ODBC MODULE_NAME sqldrivers QMAKE_LIB odbc) -qt_find_package(SQLite3 PROVIDED_TARGETS SQLite::SQLite3 MODULE_NAME sqldrivers QMAKE_LIB sqlite3) +qt_find_package(SQLite3 PROVIDED_TARGETS SQLite::SQLite3 MODULE_NAME sqldrivers QMAKE_LIB sqlite3 + VCPKG_PORT sqlite3 + VCPKG_ADD_TO_FEATURE sql-sqlite +) qt_find_package(Interbase MODULE PROVIDED_TARGETS Interbase::Interbase MODULE_NAME sqldrivers QMAKE_LIB ibase) # special case qt_find_package(Mimer MODULE PROVIDED_TARGETS MimerSQL::MimerSQL MODULE_NAME sqldrivers QMAKE_LIB mimer) @@ -60,6 +70,7 @@ qt_feature("sql-psql" PRIVATE qt_feature("sql-sqlite" PRIVATE LABEL "SQLite" CONDITION QT_FEATURE_datestring + VCPKG_DEFAULT ) qt_feature("system-sqlite" PRIVATE SYSTEM_LIBRARY LABEL " Using system provided SQLite" diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp index ffba4f775c8..13682256370 100644 --- a/src/plugins/styles/modernwindows/qwindows11style.cpp +++ b/src/plugins/styles/modernwindows/qwindows11style.cpp @@ -69,6 +69,10 @@ inline bool isAutoRaise(const QStyleOption *option) { return option->state.testFlag(QStyle::State_AutoRaise); } +inline bool hasFocus(const QStyleOption *option) +{ + return option->state.testFlag(QStyle::State_HasFocus); +} enum class ControlState { Normal, Hover, Pressed, Disabled }; inline ControlState calcControlState(const QStyleOption *option) { @@ -125,7 +129,7 @@ static constexpr int percentToAlpha(double percent) return qRound(percent * 255. / 100.); } -static constexpr std::array<QColor, 33> WINUI3ColorsLight { +static constexpr std::array<QColor, 34> WINUI3ColorsLight { QColor(0x00,0x00,0x00,percentToAlpha(3.73)), // subtleHighlightColor (fillSubtleSecondary) QColor(0x00,0x00,0x00,percentToAlpha(2.41)), // subtlePressedColor (fillSubtleTertiary) QColor(0x00,0x00,0x00,0x0F), //frameColorLight @@ -144,6 +148,7 @@ static constexpr std::array<QColor, 33> WINUI3ColorsLight { QColor(0xF9,0xF9,0xF9,percentToAlpha(50)), // fillControlSecondary QColor(0xF9,0xF9,0xF9,percentToAlpha(30)), // fillControlTertiary QColor(0xF9,0xF9,0xF9,percentToAlpha(30)), // fillControlDisabled + QColor(0xFF,0xFF,0xFF,percentToAlpha(100)), // fillControlInputActive QColor(0x00,0x00,0x00,percentToAlpha(2.41)), // fillControlAltSecondary QColor(0x00,0x00,0x00,percentToAlpha(5.78)), // fillControlAltTertiary QColor(0x00,0x00,0x00,percentToAlpha(9.24)), // fillControlAltQuarternary @@ -161,7 +166,7 @@ static constexpr std::array<QColor, 33> WINUI3ColorsLight { QColor(0x00,0x00,0x00,percentToAlpha(8.03)), // dividerStrokeDefault }; -static constexpr std::array<QColor, 33> WINUI3ColorsDark { +static constexpr std::array<QColor, 34> WINUI3ColorsDark { QColor(0xFF,0xFF,0xFF,percentToAlpha(6.05)), // subtleHighlightColor (fillSubtleSecondary) QColor(0xFF,0xFF,0xFF,percentToAlpha(4.19)), // subtlePressedColor (fillSubtleTertiary) QColor(0xFF,0xFF,0xFF,0x12), //frameColorLight @@ -180,6 +185,7 @@ static constexpr std::array<QColor, 33> WINUI3ColorsDark { QColor(0xFF,0xFF,0xFF,percentToAlpha(8.37)), // fillControlSecondary QColor(0xFF,0xFF,0xFF,percentToAlpha(3.26)), // fillControlTertiary QColor(0xFF,0xFF,0xFF,percentToAlpha(4.19)), // fillControlDisabled + QColor(0x1E,0x1E,0x1E,percentToAlpha(70)), // fillControlInputActive QColor(0x00,0x00,0x00,percentToAlpha(10.0)), // fillControlAltDefault QColor(0xFF,0xFF,0xFF,percentToAlpha(4.19)), // fillControlAltSecondary QColor(0xFF,0xFF,0xFF,percentToAlpha(6.98)), // fillControlAltTertiafillCy @@ -197,7 +203,7 @@ static constexpr std::array<QColor, 33> WINUI3ColorsDark { QColor(0xFF,0xFF,0xFF,percentToAlpha(8.37)), // dividerStrokeDefault }; -static constexpr std::array<std::array<QColor,33>, 2> WINUI3Colors { +static constexpr std::array<std::array<QColor,34>, 2> WINUI3Colors { WINUI3ColorsLight, WINUI3ColorsDark }; @@ -990,16 +996,9 @@ void QWindows11Style::drawPrimitive(PrimitiveElement element, const QStyleOption case PE_PanelLineEdit: if (const auto *panel = qstyleoption_cast<const QStyleOptionFrame *>(option)) { const auto frameRect = QRectF(option->rect).marginsRemoved(QMarginsF(1.5, 1.5, 1.5, 1.5)); - drawRoundedRect(painter, frameRect, Qt::NoPen, option->palette.brush(QPalette::Base)); - + drawRoundedRect(painter, frameRect, Qt::NoPen, inputFillBrush(option, widget)); if (panel->lineWidth > 0) proxy()->drawPrimitive(PE_FrameLineEdit, panel, painter, widget); - - const bool isMouseOver = state & State_MouseOver; - const bool hasFocus = state & State_HasFocus; - const bool isEnabled = state & State_Enabled; - if (isMouseOver && isEnabled && hasFocus && !highContrastTheme) - drawRoundedRect(painter, frameRect, Qt::NoPen, winUI3Color(subtleHighlightColor)); } break; case PE_FrameLineEdit: { @@ -2674,6 +2673,23 @@ QBrush QWindows11Style::controlFillBrush(const QStyleOption *option, ControlType return winUI3Color(colorEnums[int(controlType)][int(state)]); } +QBrush QWindows11Style::inputFillBrush(const QStyleOption *option, const QWidget *widget) const +{ + // slightly different states than in controlFillBrush + using namespace StyleOptionHelper; + const auto role = widget ? widget->backgroundRole() : QPalette::Window; + if (option->palette.isBrushSet(QPalette::Current, role)) + return option->palette.button(); + + if (isDisabled(option)) + return winUI3Color(fillControlDisabled); + if (hasFocus(option)) + return winUI3Color(fillControlInputActive); + if (isHover(option)) + return winUI3Color(fillControlSecondary); + return winUI3Color(fillControlDefault); +} + QColor QWindows11Style::controlTextColor(const QStyleOption *option, QPalette::ColorRole role) const { using namespace StyleOptionHelper; diff --git a/src/plugins/styles/modernwindows/qwindows11style_p.h b/src/plugins/styles/modernwindows/qwindows11style_p.h index a51a93ddd9b..96c2c4136e0 100644 --- a/src/plugins/styles/modernwindows/qwindows11style_p.h +++ b/src/plugins/styles/modernwindows/qwindows11style_p.h @@ -42,6 +42,7 @@ enum WINUI3Color { fillControlSecondary, // button hover color (alpha) fillControlTertiary, // button pressed color (alpha) fillControlDisabled, // button disabled color (alpha) + fillControlInputActive, // input active fillControlAltSecondary, // checkbox/RadioButton default color (alpha) fillControlAltTertiary, // checkbox/RadioButton hover color (alpha) fillControlAltQuarternary, // checkbox/RadioButton pressed color (alpha) @@ -101,6 +102,7 @@ private: ControlAlt }; 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; |
