From 4d193ef7c61fb4800868f150be6a0bb04b725463 Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周二, 20 2月 2024 15:37:54 +0800 Subject: [PATCH] minor tweaks --- src/widgets/widgetwindowagent_win.cpp | 4 ++-- src/QWindowKitConfig.cmake.in | 10 ++++++++++ qmsetup | 2 +- src/widgets/CMakeLists.txt | 6 +----- src/quick/CMakeLists.txt | 6 +----- src/core/CMakeLists.txt | 7 +------ CMakeLists.txt | 2 +- src/core/qwkglobal_p.h | 11 ----------- 8 files changed, 17 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fb89c8..60d27a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ # ---------------------------------- option(QWINDOWKIT_BUILD_STATIC "Build static libraries" OFF) option(QWINDOWKIT_BUILD_WIDGETS "Build widgets module" ON) -option(QWINDOWKIT_BUILD_QUICK "Build quick module" ON) +option(QWINDOWKIT_BUILD_QUICK "Build quick module" OFF) option(QWINDOWKIT_BUILD_EXAMPLES "Build examples" OFF) option(QWINDOWKIT_BUILD_DOCUMENTATIONS "Build documentations" OFF) option(QWINDOWKIT_INSTALL "Install library" ON) diff --git a/qmsetup b/qmsetup index 57ce7d2..10bbb20 160000 --- a/qmsetup +++ b/qmsetup @@ -1 +1 @@ -Subproject commit 57ce7d2e0a720fa6734bf13b24cd5d9e843de7cb +Subproject commit 10bbb20ddf57899138dc4e1ab6c0a012cd052eb1 diff --git a/src/QWindowKitConfig.cmake.in b/src/QWindowKitConfig.cmake.in index 42ccecd..12f60f6 100644 --- a/src/QWindowKitConfig.cmake.in +++ b/src/QWindowKitConfig.cmake.in @@ -5,4 +5,14 @@ find_dependency(QT NAMES Qt6 Qt5 COMPONENTS Core Gui REQUIRED) find_dependency(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui REQUIRED) +if ("Widgets" IN_LIST qmsetup_FIND_COMPONENTS) + find_dependency(QT NAMES Qt6 Qt5 Widgets REQUIRED) + find_dependency(Qt${QT_VERSION_MAJOR} Widgets REQUIRED) +endif() + +if ("Quick" IN_LIST qmsetup_FIND_COMPONENTS) + find_dependency(QT NAMES Qt6 Qt5 Quick REQUIRED) + find_dependency(Qt${QT_VERSION_MAJOR} Quick REQUIRED) +endif() + include("${CMAKE_CURRENT_LIST_DIR}/QWindowKitTargets.cmake") \ No newline at end of file diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index ddede41..45aa224 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -87,18 +87,13 @@ qwk_add_library(${PROJECT_NAME} AUTOGEN SOURCES ${_src} - LINKS + FEATURES cxx_std_17 LINKS_PRIVATE ${_links_private} QT_LINKS Core Gui QT_INCLUDE_PRIVATE Core Gui INCLUDE_PRIVATE kernel contexts shared PREFIX QWK_CORE SYNC_INCLUDE_OPTIONS ${_sync_include_options} -) - -set_target_properties(${PROJECT_NAME} PROPERTIES - CXX_STANDARD 17 - CXX_STANDARD_REQUIRED TRUE ) set(QWINDOWKIT_ENABLED_TARGETS ${QWINDOWKIT_ENABLED_TARGETS} ${PROJECT_NAME} PARENT_SCOPE) diff --git a/src/core/qwkglobal_p.h b/src/core/qwkglobal_p.h index afaac67..25c3f82 100644 --- a/src/core/qwkglobal_p.h +++ b/src/core/qwkglobal_p.h @@ -47,17 +47,6 @@ namespace QWK { - namespace Private { - - class ObjectHelper : public QObject { - public: - static inline bool sendEvent(QObject *obj, QEvent *event) { - return static_cast<ObjectHelper *>(obj)->event(event); - } - }; - - } - inline QPoint getMouseEventScenePos(const QMouseEvent *event) { #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) return event->scenePosition().toPoint(); diff --git a/src/quick/CMakeLists.txt b/src/quick/CMakeLists.txt index 31c603c..84c1d58 100644 --- a/src/quick/CMakeLists.txt +++ b/src/quick/CMakeLists.txt @@ -21,16 +21,12 @@ qwk_add_library(${PROJECT_NAME} AUTOGEN SOURCES ${_src} + FEATURES cxx_std_17 LINKS QWKCore QT_LINKS Core Gui Quick QT_INCLUDE_PRIVATE Core Gui Quick INCLUDE_PRIVATE PREFIX QWK_QUICK -) - -set_target_properties(${PROJECT_NAME} PROPERTIES - CXX_STANDARD 17 - CXX_STANDARD_REQUIRED TRUE ) set(QWINDOWKIT_ENABLED_TARGETS ${QWINDOWKIT_ENABLED_TARGETS} ${PROJECT_NAME} PARENT_SCOPE) diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index e6ede73..23a1122 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -20,16 +20,12 @@ qwk_add_library(${PROJECT_NAME} AUTOGEN SOURCES ${_src} + FEATURES cxx_std_17 LINKS QWKCore QT_LINKS Core Gui Widgets QT_INCLUDE_PRIVATE Core Gui Widgets INCLUDE_PRIVATE PREFIX QWK_WIDGETS -) - -set_target_properties(${PROJECT_NAME} PROPERTIES - CXX_STANDARD 17 - CXX_STANDARD_REQUIRED TRUE ) set(QWINDOWKIT_ENABLED_TARGETS ${QWINDOWKIT_ENABLED_TARGETS} ${PROJECT_NAME} PARENT_SCOPE) diff --git a/src/widgets/widgetwindowagent_win.cpp b/src/widgets/widgetwindowagent_win.cpp index f192f6b..9a4c6b3 100644 --- a/src/widgets/widgetwindowagent_win.cpp +++ b/src/widgets/widgetwindowagent_win.cpp @@ -74,7 +74,7 @@ inline void resumeWidgetEventAndDraw(QWidget *w, QEvent *event) { // Let the widget paint first - Private::ObjectHelper::sendEvent(w, event); + static_cast<QObject *>(w)->event(event); // Due to the timer or user action, Qt will repaint some regions spontaneously, // even if there is no WM_PAINT message, we must wait for it to finish painting @@ -84,7 +84,7 @@ inline void resumeWindowEventAndDraw(QWindow *window, QEvent *event) { // Let Qt paint first - Private::ObjectHelper::sendEvent(window, event); + static_cast<QObject *>(window)->event(event); // Upon receiving the WM_PAINT message, Qt will repaint the entire view, and we // must wait for it to finish painting before drawing this top border area. -- Gitblit v1.9.1