From 0778d75751d192465dffafca11b346f5a0d2f70f Mon Sep 17 00:00:00 2001 From: Nicolas Arnaud-Cormos Date: Mon, 2 Mar 2026 21:20:58 +0100 Subject: [PATCH 1/2] fix(build): Fix build with newer Qt version --- CMakeLists.txt | 5 ++++- src/gui/qttsview.cpp | 7 +++++++ tests/tst_rcwriter.cpp | 15 +++++++++------ 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce2b04f3..6fa10bc5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,7 +99,10 @@ find_package( Qt6 6.5 COMPONENTS Widgets Qml Quick Test UiTools REQUIRED) - +if(Qt6Core_VERSION VERSION_GREATER_EQUAL "6.10.0") + set(QT_NO_PRIVATE_MODULE_WARNING ON) + find_package(Qt6 ${QT_MIN_VERSION} NO_MODULE REQUIRED COMPONENTS CorePrivate WidgetsPrivate QmlPrivate) +endif() # 3rdparty # ############################################################################## add_subdirectory(3rdparty) diff --git a/src/gui/qttsview.cpp b/src/gui/qttsview.cpp index bc5b170c..500225a5 100644 --- a/src/gui/qttsview.cpp +++ b/src/gui/qttsview.cpp @@ -121,8 +121,15 @@ class QtTsProxy : public QSortFilterProxyModel void setFilterText(const QString &str) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0) + beginFilterChange(); +#endif m_filterText = str; +#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0) + endFilterChange(); +#else invalidateFilter(); +#endif } protected: diff --git a/tests/tst_rcwriter.cpp b/tests/tst_rcwriter.cpp index e4343557..9a655842 100644 --- a/tests/tst_rcwriter.cpp +++ b/tests/tst_rcwriter.cpp @@ -39,8 +39,9 @@ private slots: } if (buffer.open(QIODevice::ReadOnly)) { QFile file(Test::testDataPath() + "/tst_rcwriter/qrc_expected_default.qrc"); - file.open(QIODevice::ReadOnly); - QCOMPARE(buffer.readAll(), file.readAll()); + if (file.open(QIODevice::ReadOnly)) { + QCOMPARE(buffer.readAll(), file.readAll()); + } } } @@ -54,8 +55,9 @@ private slots: } if (buffer.open(QIODevice::ReadOnly)) { QFile file(Test::testDataPath() + "/tst_rcwriter/qrc_expected_noalias_onlyexist.qrc"); - file.open(QIODevice::ReadOnly); - QCOMPARE(buffer.readAll(), file.readAll()); + if (file.open(QIODevice::ReadOnly)) { + QCOMPARE(buffer.readAll(), file.readAll()); + } } } } @@ -111,8 +113,9 @@ private slots: // file.write(buffer.data()); // file.close(); // } - file.open(QIODevice::ReadOnly); - QCOMPARE(buffer.readAll(), file.readAll()); + if (file.open(QIODevice::ReadOnly)) { + QCOMPARE(buffer.readAll(), file.readAll()); + } } else { QWidget *widget = loader.load(&buffer); QVERIFY2(loader.errorString().isEmpty(), dialog.id.toLatin1()); From 4a20c9b31dccf1738a220eed1ca481dcc501147f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 06:25:24 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fa10bc5..f118069b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,8 +100,9 @@ find_package( COMPONENTS Widgets Qml Quick Test UiTools REQUIRED) if(Qt6Core_VERSION VERSION_GREATER_EQUAL "6.10.0") - set(QT_NO_PRIVATE_MODULE_WARNING ON) - find_package(Qt6 ${QT_MIN_VERSION} NO_MODULE REQUIRED COMPONENTS CorePrivate WidgetsPrivate QmlPrivate) + set(QT_NO_PRIVATE_MODULE_WARNING ON) + find_package(Qt6 ${QT_MIN_VERSION} NO_MODULE REQUIRED + COMPONENTS CorePrivate WidgetsPrivate QmlPrivate) endif() # 3rdparty # ##############################################################################