Sine Striker
2023-12-13 84ef238611127b9d964ecb54bea283e0141d2998
Add qt context option
4个文件已修改
22 ■■■■ 已修改文件
CMakeLists.txt 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/core/CMakeLists.txt 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/core/contexts/qtwindowcontext.cpp 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/core/windowagentbase.cpp 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CMakeLists.txt
@@ -13,6 +13,8 @@
option(QWINDOWKIT_BUILD_DOCUMENTATIONS "Build documentations" OFF)
option(QWINDOWKIT_INSTALL "Install library" ON)
option(QWINDOWKIT_FORCE_QT_WINDOW_CONTEXT "Enable Qt Window Context anyway" OFF)
# ----------------------------------
# CMake Settings
# ----------------------------------
src/core/CMakeLists.txt
@@ -20,13 +20,26 @@
    contexts/abstractwindowcontext.cpp
)
set(_defines_private)
if(WIN32)
    list(APPEND _src
        qwindowkit_windows.h
        qwindowkit_windows.cpp
    )
    if(QWINDOWKIT_FORCE_QT_WINDOW_CONTEXT)
        list(APPEND _src
            contexts/qtwindowcontext_p.h
            contexts/qtwindowcontext.cpp
        )
        list(APPEND _defines_private QWINDOWKIT_FORCE_QT_WINDOW_CONTEXT)
    else()
        list(APPEND _src
        contexts/win32windowcontext_p.h
        contexts/win32windowcontext.cpp
    )
    endif()
else()
    list(APPEND _src
        contexts/qtwindowcontext_p.h
@@ -44,6 +57,7 @@
qwk_add_library(${PROJECT_NAME} AUTOGEN
    SOURCES ${_src}
    DEFINES_PRIVATE ${_defines_private}
    LINKS
    QT_LINKS Core Gui
    QT_INCLUDE_PRIVATE Core Gui
src/core/contexts/qtwindowcontext.cpp
@@ -54,7 +54,7 @@
    }
    bool QtWindowContext::setupHost() {
        return false;
        return true;
    }
}
src/core/windowagentbase.cpp
@@ -3,7 +3,7 @@
#include "qwkglobal_p.h"
#ifdef Q_OS_WINDOWS
#if defined(Q_OS_WINDOWS) && !defined(QWINDOWKIT_FORCE_QT_WINDOW_CONTEXT)
#  include "win32windowcontext_p.h"
#else
#  include "qtwindowcontext_p.h"
@@ -28,7 +28,7 @@
        if (windowContextFactoryMethod) {
            return windowContextFactoryMethod();
        }
#ifdef Q_OS_WINDOWS
#if defined(Q_OS_WINDOWS) && !defined(QWINDOWKIT_FORCE_QT_WINDOW_CONTEXT)
        return new Win32WindowContext();
#else
        return new QtWindowContext();