From c53f981a56556ac21ad2640036e7026777fb7718 Mon Sep 17 00:00:00 2001 From: EndrII Date: Sat, 21 Dec 2024 22:34:42 +0100 Subject: [PATCH] update web engine config --- CMakeLists.txt | 3 +++ testcases/CMakeLists.txt | 4 +--- tests/CMakeLists.txt | 4 ++++ tests/units/linux/webenginetest.cpp | 7 ++----- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 21a803ce..6347c90b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,9 @@ else() endif() if (CQT_DEPLOYER_TESTS) + find_package(Qt${QT_VERSION_MAJOR} COMPONENTS WebEngineQuick) + + add_subdirectory(testcases) add_subdirectory(tests) else() diff --git a/testcases/CMakeLists.txt b/testcases/CMakeLists.txt index 27dc746d..f3217368 100644 --- a/testcases/CMakeLists.txt +++ b/testcases/CMakeLists.txt @@ -19,10 +19,8 @@ if (NOT WIN32) add_subdirectory(QMLFileDialog) add_subdirectory(virtualkeyboard) - # this tests is not actual for the qt 6.8 and later. Use WebView. - if (QT_VERSION_MAJOR LESS_EQUAL 6 AND QT_VERSION_MINOR LESS_EQUAL 7) + if (Qt${QT_VERSION_MAJOR}WebEngineQuick_FOUND) add_subdirectory(quicknanobrowser) add_subdirectory(webui) - endif() endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3452ac90..f649174a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -47,6 +47,10 @@ set(PUBLIC_INCUDE_DIR ${PUBLIC_INCUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/modules" add_definitions(-DQT_BASE_DIR="${QT_QT_ROOT}/") add_definitions(-DTEST_BIN_DIR="${CMAKE_CURRENT_LIST_DIR}/../testcases/bin/") +if (Qt${QT_VERSION_MAJOR}WebEngineQuick_FOUND) + add_definitions(-DUSE_WEBENGINE) +endif() + add_executable(${CURRENT_PROJECT} ${SOURCE_CPP}) target_link_libraries(${CURRENT_PROJECT} PRIVATE Qt${QT_VERSION_MAJOR}::Test Deploy) diff --git a/tests/units/linux/webenginetest.cpp b/tests/units/linux/webenginetest.cpp index efbeceb3..9dfa5677 100644 --- a/tests/units/linux/webenginetest.cpp +++ b/tests/units/linux/webenginetest.cpp @@ -8,7 +8,7 @@ #include "webenginetest.h" -#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0) +#ifdef USE_WEBENGINE #include "modules.h" #endif @@ -20,8 +20,7 @@ void WebEngineTest::test() { -#ifdef Q_OS_UNIX -#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0) +#ifdef USE_WEBENGINE TestUtils utils; QString bin = TestBinDir + "quicknanobrowser"; @@ -41,7 +40,5 @@ void WebEngineTest::test() { runTestParams({"-bin", bin, "clear" , "-qmake", qmake}, &comapareTree); - -#endif #endif }