Skip to content

Commit 2079a66

Browse files
DanielNicolettiKDABdantti
authored andcommitted
Remove Qt5 support
1 parent 9296011 commit 2079a66

11 files changed

Lines changed: 14 additions & 205 deletions

.github/workflows/build-external-graphviz.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ jobs:
6767
--warn-uninitialized -Werror=dev
6868
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
6969
-DCMAKE_OSX_ARCHITECTURES="arm64"
70-
-DKDSME_QT6=ON
7170
-DBUILD_TESTING=${{ matrix.build_type == 'Debug' }}
7271
-DKDSME_EXAMPLES=ON
7372
-DKDSME_DOCS=${{ matrix.build_type == 'Debug' && runner.os == 'Linux' }}

.github/workflows/build.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ jobs:
2929
- Shared
3030
- Static
3131
config:
32-
- qt_version: 5.15.2
33-
qt_arch: win64_msvc2019_64
34-
macos_architectures: "x86_64"
3532
- qt_version: 6.6.2
3633
qt_modules: qtscxml
3734
qt_arch: win64_msvc2019_64
@@ -99,7 +96,6 @@ jobs:
9996
--warn-uninitialized -Werror=dev
10097
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
10198
-DCMAKE_OSX_ARCHITECTURES="${{ matrix.config.macos_architectures }}"
102-
-DKDSME_QT6=${{ startsWith(matrix.config.qt_version, '6.') }}
10399
-DBUILD_TESTING=${{ matrix.build_type == 'Debug' }}
104100
-DKDSME_EXAMPLES=ON
105101
-DKDSME_DOCS=${{ matrix.build_type == 'Debug' && runner.os == 'Linux' }}

CMakeLists.txt

Lines changed: 11 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
# Currently shared graphviz builds on Windows have link issues.
2929
# Default=true
3030
#
31-
# -DKDSME_QT6=[true|false]
32-
# Build against Qt6 rather than Qt5
33-
# Default=true
34-
#
3531
# -DKDSME_DOCS=[true|false]
3632
# Build the documentation. Documentation is never built when cross-compiling.
3733
# Default=true
@@ -100,9 +96,6 @@ renamed_option(BUILD_DOCS KDSME_DOCS)
10096
renamed_option(BUILD_EXAMPLES KDSME_EXAMPLES)
10197
renamed_option(BUILD_TESTS BUILD_TESTING)
10298

103-
option(KDSME_QT6 "Build against Qt 6" ON)
104-
renamed_option(BUILD_QT6 KDSME_QT6)
105-
10699
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
107100

108101
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@@ -124,20 +117,13 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
124117
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
125118
endif()
126119

127-
if(KDSME_QT6)
128-
set(QT_VERSION_MAJOR 6)
129-
set(QT_MIN_VERSION "6.1.0")
130-
find_package(
131-
Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Quick QuickControls2 QuickWidgets Test Widgets StateMachine
132-
)
133-
set(KDSME_LIBRARY_QTID "-qt6")
134-
else()
135-
set(QT_VERSION_MAJOR 5)
136-
set(QT_MIN_VERSION "5.15")
137-
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Quick QuickWidgets Test Widgets)
138-
set(KDSME_LIBRARY_QTID "")
139-
include(ECMGeneratePriFile)
140-
endif()
120+
set(QT_VERSION_MAJOR 6)
121+
set(QT_MIN_VERSION "6.1.0")
122+
find_package(
123+
Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Quick QuickControls2 QuickWidgets Test Widgets StateMachine
124+
)
125+
set(KDSME_LIBRARY_QTID "-qt6")
126+
141127
include(KDQtInstallPaths) #to set QT_INSTALL_FOO variables
142128

143129
find_package(Qt${QT_VERSION_MAJOR}RemoteObjects ${QT_MIN_VERSION} CONFIG QUIET)
@@ -156,17 +142,6 @@ set_package_properties(
156142
PURPOSE "Needed for the Qt SCXML adapter (adapter itself depends on Qt RemoteObjects)"
157143
)
158144

159-
# QtXmlPatterns is removed since Qt6
160-
if(NOT KDSME_QT6)
161-
find_package(Qt5XmlPatterns ${QT_MIN_VERSION} CONFIG QUIET)
162-
set_package_properties(
163-
Qt5XmlPatterns PROPERTIES
164-
TYPE OPTIONAL
165-
DESCRIPTION "Qt5 XmlPatterns library"
166-
PURPOSE "Required with Qt5 for unit tests dealing with XML input/output"
167-
)
168-
endif()
169-
170145
include(CheckCCompilerFlag)
171146
include(CheckCXXCompilerFlag)
172147
include(CheckIncludeFiles)
@@ -210,11 +185,9 @@ set(LIB_INSTALL_DIR
210185
${CMAKE_INSTALL_LIBDIR}
211186
CACHE STRING "Library install destination."
212187
)
213-
if(KDSME_QT6)
214-
set(INCLUDE_INSTALL_ROOT ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}${KDSME_LIBRARY_QTID})
215-
else()
216-
set(INCLUDE_INSTALL_ROOT ${CMAKE_INSTALL_INCLUDEDIR}/)
217-
endif()
188+
189+
set(INCLUDE_INSTALL_ROOT ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}${KDSME_LIBRARY_QTID})
190+
218191
set(INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_ROOT}/${CMAKE_PROJECT_NAME})
219192
set(XDG_DATA_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR}/${CMAKE_PROJECT_NAME})
220193

@@ -310,13 +283,6 @@ if((CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND NOT
310283
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wextra -Woverloaded-virtual -Winit-self")
311284
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wmissing-include-dirs -Wunused -Wno-div-by-zero -Wundef")
312285
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpointer-arith -Wmissing-noreturn -Werror=return-type -Wswitch")
313-
if(NOT KDSME_QT6)
314-
if(HAVE_GXX_GNUXX11) # QNX needs gnu++0x rather than c++0x for compiling QML V4 private headers
315-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
316-
elseif(HAVE_GXX_CXX11)
317-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
318-
endif()
319-
endif()
320286
if(MINGW)
321287
# mingw will error out on the crazy casts in probe.cpp without this
322288
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
@@ -339,7 +305,7 @@ add_definitions(
339305
-DQT_USE_QSTRINGBUILDER
340306
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
341307
-DQT_USE_FAST_OPERATOR_PLUS
342-
-DQT_DISABLE_DEPRECATED_BEFORE=0x050F00
308+
-DQT_DISABLE_DEPRECATED_BEFORE=0x060900
343309
)
344310

345311
if(MSVC)

CMakePresets.json

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,12 @@
3535
"dev": false
3636
}
3737
},
38-
{
39-
"name": "dev5-external-graphviz",
40-
"description": "Qt5 dev build with external graphviz",
41-
"inherits": "dev-base",
42-
"binaryDir": "${sourceDir}/build-dev5-external-graphviz",
43-
"cacheVariables": {
44-
"KDSME_QT6": "OFF",
45-
"KDSME_INTERNAL_GRAPHVIZ": "OFF"
46-
}
47-
},
48-
{
49-
"name": "dev5",
50-
"description": "Qt5 dev build",
51-
"inherits": "dev-base",
52-
"binaryDir": "${sourceDir}/build-dev5",
53-
"cacheVariables": {
54-
"KDSME_QT6": "OFF",
55-
"KDSME_INTERNAL_GRAPHVIZ": "ON"
56-
}
57-
},
5838
{
5939
"name": "dev6-external-graphviz",
6040
"description": "Qt6 dev build with external graphviz",
6141
"inherits": "dev-base",
6242
"binaryDir": "${sourceDir}/build-dev6-external-graphviz",
6343
"cacheVariables": {
64-
"KDSME_QT6": "ON",
6544
"KDSME_INTERNAL_GRAPHVIZ": "OFF"
6645
}
6746
},
@@ -71,38 +50,6 @@
7150
"inherits": "dev-base",
7251
"binaryDir": "${sourceDir}/build-dev6",
7352
"cacheVariables": {
74-
"KDSME_QT6": "ON",
75-
"KDSME_INTERNAL_GRAPHVIZ": "ON"
76-
}
77-
},
78-
{
79-
"name": "rel-base",
80-
"description": "rel-base",
81-
"inherits": "base",
82-
"hidden": true,
83-
"cacheVariables": {
84-
"CMAKE_BUILD_TYPE": "Release",
85-
"KDSME_QT6": "OFF",
86-
"BUILD_TESTING": "OFF"
87-
}
88-
},
89-
{
90-
"name": "rel5-external-graphviz",
91-
"description": "Qt5 release build with external graphviz",
92-
"inherits": "rel-base",
93-
"binaryDir": "${sourceDir}/build-rel5-external-graphviz",
94-
"cacheVariables": {
95-
"KDSME_QT6": "OFF",
96-
"KDSME_INTERNAL_GRAPHVIZ": "OFF"
97-
}
98-
},
99-
{
100-
"name": "rel5",
101-
"description": "Qt5 release build",
102-
"inherits": "rel-base",
103-
"binaryDir": "${sourceDir}/build-rel5",
104-
"cacheVariables": {
105-
"KDSME_QT6": "OFF",
10653
"KDSME_INTERNAL_GRAPHVIZ": "ON"
10754
}
10855
},
@@ -112,7 +59,6 @@
11259
"inherits": "rel-base",
11360
"binaryDir": "${sourceDir}/build-rel6-external-graphviz",
11461
"cacheVariables": {
115-
"KDSME_QT6": "ON",
11662
"KDSME_INTERNAL_GRAPHVIZ": "OFF"
11763
}
11864
},
@@ -122,7 +68,6 @@
12268
"inherits": "rel-base",
12369
"binaryDir": "${sourceDir}/build-rel6",
12470
"cacheVariables": {
125-
"KDSME_QT6": "ON",
12671
"KDSME_INTERNAL_GRAPHVIZ": "ON"
12772
}
12873
},

src/core/CMakeLists.txt

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,10 @@ add_library(KDSME::Core ALIAS kdstatemachineeditor_core)
8282
target_link_libraries(
8383
kdstatemachineeditor_core
8484
PRIVATE Qt${QT_VERSION_MAJOR}::Quick # TODO: Get rid off this
85+
Qt6::StateMachine
8586
PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui
8687
)
8788

88-
if(KDSME_QT6)
89-
target_link_libraries(kdstatemachineeditor_core PRIVATE Qt6::StateMachine)
90-
endif()
91-
9289
if(NOT KDSME_INTERNAL_GRAPHVIZ)
9390
target_include_directories(kdstatemachineeditor_core PRIVATE ${GRAPHVIZ_INCLUDE_DIR})
9491
endif()
@@ -189,22 +186,6 @@ install(
189186
DESTINATION ${INCLUDE_INSTALL_DIR}/core
190187
)
191188

192-
if(NOT KDSME_QT6)
193-
ecm_generate_pri_file(
194-
BASE_NAME
195-
KDSMECore
196-
LIB_NAME
197-
kdstatemachineeditor_core
198-
DEPS
199-
"core gui"
200-
FILENAME_VAR
201-
PRI_FILENAME
202-
INCLUDE_INSTALL_DIR
203-
${INCLUDE_INSTALL_DIR}/core
204-
)
205-
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
206-
endif()
207-
208189
if(BUILD_TESTING)
209190
add_subdirectory(tests)
210191
endif()

src/core/tests/CMakeLists.txt

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414

1515
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-test.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-test.h)
1616

17-
# QtXmlPatterns fails badly on OSX -- see https://bugreports.qt-project.org/browse/QTBUG-40818
18-
if(TARGET Qt5::XmlPatterns_FOUND AND NOT APPLE)
19-
add_definitions(-DUSE_QT_XMLPATTERNS_LIB)
20-
list(APPEND KDSME_TESTHELPER_EXTRA_LIBS Qt5::XmlPatterns)
21-
endif()
22-
2317
add_library(kdsme_testhelper STATIC parsehelper.cpp util.cpp)
2418
target_link_libraries(kdsme_testhelper Qt::Test kdstatemachineeditor_core)
2519

@@ -35,24 +29,19 @@ ecm_add_test(test_qmlexport.cpp LINK_LIBRARIES kdsme_testhelper)
3529

3630
if(TARGET Qt::RemoteObjects)
3731
set(SRCS test_qsmintegration.cpp)
38-
if(NOT KDSME_QT6)
39-
qt_generate_repc(SRCS ../../debuginterface/debuginterface.rep REPLICA)
40-
endif()
4132
ecm_add_test(
4233
${SRCS}
4334
TEST_NAME
4435
test_qsmintegration
4536
LINK_LIBRARIES
4637
Qt::RemoteObjects
4738
Qt::Test
39+
Qt::StateMachine
4840
kdstatemachineeditor_debuginterfaceclient
4941
kdstatemachineeditor_debuginterfacesource
5042
kdsme_testhelper
5143
)
52-
if(KDSME_QT6)
53-
target_link_libraries(test_qsmintegration Qt6::StateMachine)
54-
qt_add_repc_replicas(test_qsmintegration ../../debuginterface/debuginterface.rep)
55-
endif()
44+
qt_add_repc_replicas(test_qsmintegration ../../debuginterface/debuginterface.rep)
5645
endif()
5746

5847
ecm_add_test(test_scxmlimport.cpp LINK_LIBRARIES kdsme_testhelper)

src/core/tests/test_scxmlexport.cpp

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
#include <QDebug>
2323
#include <QTest>
2424

25-
#ifdef USE_QT_XMLPATTERNS_LIB
26-
#include <QBuffer>
27-
#include <QXmlQuery>
28-
#endif
29-
3025
#define QVERIFY_RETURN(statement, retval) \
3126
do { \
3227
if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__)) \
@@ -35,27 +30,6 @@
3530

3631
using namespace KDSME;
3732

38-
namespace {
39-
40-
#ifdef USE_QT_XMLPATTERNS_LIB
41-
QStringList query(QByteArray xml, const QString &sourceCode)
42-
{
43-
static const QString preamble =
44-
"declare default element namespace \"http://www.w3.org/2005/07/scxml\";";
45-
46-
QBuffer buffer(&xml);
47-
buffer.open(QIODevice::ReadOnly);
48-
QXmlQuery query;
49-
query.bindVariable("input", &buffer);
50-
query.setQuery(preamble + sourceCode);
51-
QStringList result;
52-
query.evaluateTo(&result);
53-
return result;
54-
}
55-
#endif
56-
57-
}
58-
5933
class ScxmlExportTest : public QObject
6034
{
6135
Q_OBJECT
@@ -107,18 +81,6 @@ void ScxmlExportTest::testSimpleStateMachine()
10781
const bool success = exporter.exportMachine(&root);
10882
QVERIFY(success);
10983
QVERIFY(!output.isEmpty());
110-
111-
#ifdef USE_QT_XMLPATTERNS_LIB
112-
QStringList stateMachineIds = query(output, "doc($input)/scxml/@name/string()");
113-
QCOMPARE(stateMachineIds, QStringList() << "root");
114-
QStringList stateIds = query(output, "doc($input)/scxml/state/@id/string()");
115-
QCOMPARE(stateIds, QStringList() << "s1"
116-
<< "s2");
117-
QStringList initialStateIds = query(output, "doc($input)/scxml/@initial/string()");
118-
QCOMPARE(initialStateIds, QStringList() << "s1");
119-
QStringList transitions = query(output, "doc($input)/scxml/state[@id='s1']/transition/@event/string()");
120-
QCOMPARE(transitions, QStringList() << "e1");
121-
#endif
12284
}
12385

12486
QTEST_MAIN(ScxmlExportTest)

src/view/CMakeLists.txt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -118,22 +118,6 @@ install(
118118
DESTINATION ${INCLUDE_INSTALL_DIR}/view
119119
)
120120

121-
if(NOT KDSME_QT6)
122-
ecm_generate_pri_file(
123-
BASE_NAME
124-
KDSMEView
125-
LIB_NAME
126-
kdstatemachineeditor_view
127-
DEPS
128-
"core gui qml quickwidgets widgets KDSMECore"
129-
FILENAME_VAR
130-
PRI_FILENAME
131-
INCLUDE_INSTALL_DIR
132-
${INCLUDE_INSTALL_DIR}/view
133-
)
134-
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
135-
endif()
136-
137121
if(BUILD_TESTING)
138122
add_subdirectory(tests)
139123
endif()

src/view/quick/quickmaskedmousearea.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,8 @@ void QuickMaskedMouseArea::mouseReleaseEvent(QMouseEvent *event)
148148

149149

150150
const int threshold = qApp->styleHints()->startDragDistance();
151-
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
152151
const int eventX = static_cast<int>(event->position().x());
153152
const int eventY = static_cast<int>(event->position().y());
154-
#else
155-
const int eventX = event->x();
156-
const int eventY = event->y();
157-
#endif
158153
const bool isClick = (threshold >= qAbs(eventX - m_pressPoint.x()) && threshold >= qAbs(eventY - m_pressPoint.y()));
159154

160155
if (isClick)

0 commit comments

Comments
 (0)