Skip to content

Commit b6bbe02

Browse files
committed
[Qt6] Focus on Qt6
Drop Qt4 compatibility Replace o2_WITH_QT5 with o2_WITH_QT6
1 parent b342c02 commit b6bbe02

File tree

16 files changed

+119
-244
lines changed

16 files changed

+119
-244
lines changed

.github/workflows/build.yml

+49-28
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1-
name: 🧪Qt 5 linux build
1+
name: 🧪 Linux build
22

33
on:
44
push:
5+
branches:
6+
- main
57
pull_request:
68
branches:
79
- main
810

911
jobs:
1012
build:
13+
strategy:
14+
matrix:
15+
qt_version: [5, 6]
16+
1117
runs-on: ubuntu-latest
1218

1319
steps:
@@ -16,41 +22,56 @@ jobs:
1622

1723
- name: Get deps
1824
run: |
25+
if [ "${{ matrix.qt_version }}" -eq 6 ]; then
26+
QT_PACKAGES="qt6-base-dev \
27+
qtkeychain-qt6-dev \
28+
qt6-webengine-dev \
29+
qt6-webengine-dev-tools \
30+
libglx-dev \
31+
libgl1-mesa-dev"
32+
else
33+
QT_PACKAGES="qtbase5-dev \
34+
qt5keychain-dev \
35+
qtscript5-dev \
36+
qtwebengine5-dev"
37+
fi
1938
sudo apt-get install \
2039
cmake \
2140
ninja-build \
2241
clang \
23-
qtbase5-dev \
24-
qt5keychain-dev \
25-
qtscript5-dev \
26-
qtwebengine5-dev
42+
${QT_PACKAGES}
43+
2744
2845
- name: Build
2946
run: |
30-
mkdir -p build
31-
cd build
47+
if [ "${{ matrix.qt_version }}" -eq 6 ]; then
48+
CMAKE_QT_OPTION="o2_WITH_QT6:BOOL=ON"
49+
else
50+
CMAKE_QT_OPTION="o2_WITH_QT6:BOOL=OFF"
51+
fi
3252
cmake -GNinja \
33-
-Do2_BUILD_EXAMPLES:BOOL=ON \
34-
-Do2_WITH_TESTS=ON \
35-
-Do2_SHOW_TRACE:BOOL=ON \
36-
-Do2_WITH_DROPBOX:BOOL=ON \
37-
-Do2_WITH_FACEBOOK:BOOL=ON \
38-
-Do2_WITH_FLICKR:BOOL=ON \
39-
-Do2_WITH_GOOGLE:BOOL=ON \
40-
-Do2_WITH_HUBIC:BOOL=ON \
41-
-Do2_WITH_KEYCHAIN:BOOL=ON \
42-
-Do2_WITH_MSGRAPH:BOOL=ON \
43-
-Do2_WITH_OAUTH1:BOOL=ON \
44-
-Do2_WITH_QT5:BOOL=ON \
45-
-Do2_WITH_SKYDRIVE:BOOL=ON \
46-
-Do2_WITH_SMUGMUG:BOOL=ON \
47-
-Do2_WITH_SPOTIFY:BOOL=ON \
48-
-Do2_WITH_SURVEYMONKEY:BOOL=ON \
49-
-Do2_WITH_TWITTER:BOOL=ON \
50-
-Do2_WITH_UBER:BOOL=ON \
51-
-Do2_WITH_VIMEO:BOOL=ON \
52-
..
53-
ninja
53+
-Do2_BUILD_EXAMPLES:BOOL=ON \
54+
-Do2_WITH_TESTS=ON \
55+
-Do2_SHOW_TRACE:BOOL=ON \
56+
-Do2_WITH_DROPBOX:BOOL=ON \
57+
-Do2_WITH_FACEBOOK:BOOL=ON \
58+
-Do2_WITH_FLICKR:BOOL=ON \
59+
-Do2_WITH_GOOGLE:BOOL=ON \
60+
-Do2_WITH_HUBIC:BOOL=ON \
61+
-Do2_WITH_KEYCHAIN:BOOL=ON \
62+
-Do2_WITH_MSGRAPH:BOOL=ON \
63+
-Do2_WITH_OAUTH1:BOOL=ON \
64+
-D${CMAKE_QT_OPTION} \
65+
-Do2_WITH_SKYDRIVE:BOOL=ON \
66+
-Do2_WITH_SMUGMUG:BOOL=ON \
67+
-Do2_WITH_SPOTIFY:BOOL=ON \
68+
-Do2_WITH_SURVEYMONKEY:BOOL=ON \
69+
-Do2_WITH_TWITTER:BOOL=ON \
70+
-Do2_WITH_UBER:BOOL=ON \
71+
-Do2_WITH_VIMEO:BOOL=ON \
72+
-S . \
73+
-B build
74+
cmake --build build
5475
5576
- name: Run Tests
5677
run: |

.github/workflows/clang_static_analyzer/start.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ scan-build -o scanbuildoutput -plist -v cmake -Do2_BUILD_EXAMPLES:BOOL=ON \
3232
-Do2_WITH_KEYCHAIN:BOOL=ON \
3333
-Do2_WITH_MSGRAPH:BOOL=ON \
3434
-Do2_WITH_OAUTH1:BOOL=ON \
35-
-Do2_WITH_QT5:BOOL=ON \
35+
-Do2_WITH_QT6:BOOL=OFF \
3636
-Do2_WITH_SKYDRIVE:BOOL=ON \
3737
-Do2_WITH_SMUGMUG:BOOL=ON \
3838
-Do2_WITH_SPOTIFY:BOOL=ON \

.github/workflows/codeql.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
-Do2_WITH_KEYCHAIN:BOOL=ON \
9999
-Do2_WITH_MSGRAPH:BOOL=ON \
100100
-Do2_WITH_OAUTH1:BOOL=ON \
101-
-Do2_WITH_QT5:BOOL=ON \
101+
-Do2_WITH_QT6:BOOL=OFF \
102102
-Do2_WITH_SKYDRIVE:BOOL=ON \
103103
-Do2_WITH_SMUGMUG:BOOL=ON \
104104
-Do2_WITH_SPOTIFY:BOOL=ON \

.github/workflows/coverity-scan.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
-Do2_WITH_KEYCHAIN:BOOL=ON \
3737
-Do2_WITH_MSGRAPH:BOOL=ON \
3838
-Do2_WITH_OAUTH1:BOOL=ON \
39-
-Do2_WITH_QT5:BOOL=ON \
39+
-Do2_WITH_QT6:BOOL=OFF \
4040
-Do2_WITH_SKYDRIVE:BOOL=ON \
4141
-Do2_WITH_SMUGMUG:BOOL=ON \
4242
-Do2_WITH_SPOTIFY:BOOL=ON \

.github/workflows/mac/install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ cmake -GNinja \
2626
-Do2_WITH_KEYCHAIN:BOOL=ON \
2727
-Do2_WITH_MSGRAPH:BOOL=ON \
2828
-Do2_WITH_OAUTH1:BOOL=ON \
29-
-Do2_WITH_QT5:BOOL=ON \
29+
-Do2_WITH_QT6:BOOL=OFF \
3030
-Do2_WITH_SKYDRIVE:BOOL=ON \
3131
-Do2_WITH_SMUGMUG:BOOL=ON \
3232
-Do2_WITH_SPOTIFY:BOOL=ON \

CMakeLists.txt

+4-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ set(API_VERSION ${VER_MAJOR}.${VER_MINOR}.${API_VER_PATCH})
1818

1919
project(o2 VERSION ${PROJECT_VERSION})
2020

21-
option(o2_WITH_QT5 "Use Qt5" ON)
21+
option(o2_WITH_QT6 "Use Qt6" ON)
2222

2323
set(o2_LIB_SUFFIX "" CACHE STRING "Suffix for install 'lib' directory, e.g. 64 for lib64")
2424

@@ -89,14 +89,11 @@ if (o2_WITH_OAUTH1)
8989
endif()
9090

9191
if(o2_WITH_KEYCHAIN)
92-
if(o2_WITH_QT5)
93-
find_package(Qt5Keychain CONFIG REQUIRED)
94-
else()
92+
if(o2_WITH_QT6)
9593
find_package(Qt6Keychain CONFIG REQUIRED)
94+
else()
95+
find_package(Qt5Keychain CONFIG REQUIRED)
9696
endif()
97-
98-
message("Found QTKeychain")
99-
10097
endif(o2_WITH_KEYCHAIN)
10198

10299
if(o2_WITH_TWITTER OR o2_WITH_DROPBOX OR o2_WITH_FLICKR OR o2_WITH_SMUGMUG)

examples/facebookdemo/CMakeLists.txt

+7-25
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,11 @@ set(CMAKE_AUTOMOC ON)
66
set(CMAKE_INCLUDE_CURRENT_DIR ON)
77
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
88

9-
if(o2_WITH_QT5)
10-
# Qt5 packages find their own dependencies.
11-
find_package(Qt5Core REQUIRED)
12-
find_package(Qt5Widgets REQUIRED)
13-
find_package(Qt5Script REQUIRED)
14-
find_package(Qt5Network REQUIRED)
15-
else(o2_WITH_QT5)
16-
set(QT_USE_QTNETWORK true)
17-
set(QT_USE_QTSCRIPT true)
18-
find_package(Qt4 REQUIRED)
19-
endif(o2_WITH_QT5)
20-
21-
if (NOT o2_WITH_QT5)
22-
include( ${QT_USE_FILE} )
23-
endif(NOT o2_WITH_QT5)
9+
if(o2_WITH_QT6)
10+
find_package(Qt6 COMPONENTS Core Widgets Network REQUIRED)
11+
else()
12+
find_package(Qt5 COMPONENTS Core Widgets Script Network REQUIRED)
13+
endif()
2414

2515
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" )
2616

@@ -30,15 +20,7 @@ set(fb_SRCS
3020
fbdemo.h
3121
)
3222

33-
if(NOT o2_WITH_QT5)
34-
add_definitions(${QT4_DEFINITIONS})
35-
endif(NOT o2_WITH_QT5)
36-
3723
add_executable( fbexample ${fb_SRCS} )
3824

39-
if(o2_WITH_QT5)
40-
target_link_libraries( fbexample Qt5::Core Qt5::Widgets Qt5::Network )
41-
target_link_libraries( fbexample o2 )
42-
else(o2_WITH_QT5)
43-
target_link_libraries( fbexample ${QT_LIBRARIES} o2 )
44-
endif(o2_WITH_QT5)
25+
target_link_libraries( fbexample Qt::Core Qt::Widgets Qt::Network )
26+
target_link_libraries( fbexample o2 )

examples/facebookexternalinterceptordemo/CMakeLists.txt

+7-25
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,11 @@ set(CMAKE_AUTOMOC ON)
66
set(CMAKE_INCLUDE_CURRENT_DIR ON)
77
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
88

9-
if(o2_WITH_QT5)
10-
# Qt5 packages find their own dependencies.
11-
find_package(Qt5Core REQUIRED)
12-
find_package(Qt5Widgets REQUIRED)
13-
find_package(Qt5Script REQUIRED)
14-
find_package(Qt5Network REQUIRED)
15-
else(o2_WITH_QT5)
16-
set(QT_USE_QTNETWORK true)
17-
set(QT_USE_QTSCRIPT true)
18-
find_package(Qt4 REQUIRED)
19-
endif(o2_WITH_QT5)
20-
21-
if (NOT o2_WITH_QT5)
22-
include( ${QT_USE_FILE} )
23-
endif(NOT o2_WITH_QT5)
9+
if(o2_WITH_QT6)
10+
find_package(Qt6 COMPONENTS Core Widgets Network REQUIRED)
11+
else()
12+
find_package(Qt5 COMPONENTS Core Widgets Script Network REQUIRED)
13+
endif()
2414

2515
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" )
2616

@@ -29,15 +19,7 @@ set(fb_SRCS
2919
fbdemo.cpp
3020
)
3121

32-
if(NOT o2_WITH_QT5)
33-
add_definitions(${QT4_DEFINITIONS})
34-
endif(NOT o2_WITH_QT5)
35-
3622
add_executable( fbexample ${fb_SRCS} )
3723

38-
if(o2_WITH_QT5)
39-
qt5_use_modules( fbexample Core Widgets Network )
40-
target_link_libraries( fbexample o2 )
41-
else(o2_WITH_QT5)
42-
target_link_libraries( fbexample ${QT_LIBRARIES} o2 )
43-
endif(o2_WITH_QT5)
24+
target_link_libraries( fbexample Qt::Core Qt::Widgets Qt::Network )
25+
target_link_libraries( fbexample o2 )

examples/msgraphdemo/CMakeLists.txt

+7-25
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,11 @@ set(CMAKE_AUTOMOC ON)
66
set(CMAKE_INCLUDE_CURRENT_DIR ON)
77
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
88

9-
if(o2_WITH_QT5)
10-
# Qt5 packages find their own dependencies.
11-
find_package(Qt5Core REQUIRED)
12-
find_package(Qt5Gui REQUIRED)
13-
find_package(Qt5Network REQUIRED)
14-
find_package(Qt5Widgets REQUIRED)
15-
else(o2_WITH_QT5)
16-
set(QT_USE_QTNETWORK true)
17-
set(QT_USE_QTSCRIPT true)
18-
find_package(Qt4 REQUIRED)
19-
endif(o2_WITH_QT5)
20-
21-
if (NOT o2_WITH_QT5)
22-
include( ${QT_USE_FILE} )
23-
endif(NOT o2_WITH_QT5)
9+
if(o2_WITH_QT6)
10+
find_package(Qt6 COMPONENTS Core Widgets Network REQUIRED)
11+
else()
12+
find_package(Qt5 COMPONENTS Core Widgets Script Network REQUIRED)
13+
endif()
2414

2515
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" )
2616

@@ -30,15 +20,7 @@ set(msgraph_SRCS
3020
msgraphdemo.h
3121
)
3222

33-
if(NOT o2_WITH_QT5)
34-
add_definitions(${QT4_DEFINITIONS})
35-
endif(NOT o2_WITH_QT5)
36-
3723
add_executable( msgraphexample ${msgraph_SRCS} )
3824

39-
if(o2_WITH_QT5)
40-
target_link_libraries( msgraphexample Qt5::Core Qt5::Gui Qt5::Network Qt5::Widgets )
41-
target_link_libraries( msgraphexample o2 )
42-
else(o2_WITH_QT5)
43-
target_link_libraries( msgraphexample ${QT_LIBRARIES} o2 )
44-
endif(o2_WITH_QT5)
25+
target_link_libraries( msgraphexample Qt::Core Qt::Widgets Qt::Network )
26+
target_link_libraries( msgraphexample o2 )

examples/msgraphexternalinterceptordemo/CMakeLists.txt

+7-27
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,11 @@ set(CMAKE_AUTOUIC ON)
77
set(CMAKE_INCLUDE_CURRENT_DIR ON)
88
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
99

10-
if(o2_WITH_QT5)
11-
# Qt5 packages find their own dependencies.
12-
find_package(Qt5Core REQUIRED)
13-
find_package(Qt5Widgets REQUIRED)
14-
find_package(Qt5Script REQUIRED)
15-
find_package(Qt5Network REQUIRED)
16-
find_package(Qt5WebEngine REQUIRED)
17-
find_package(Qt5WebEngineWidgets REQUIRED)
18-
else(o2_WITH_QT5)
19-
set(QT_USE_QTNETWORK true)
20-
set(QT_USE_QTSCRIPT true)
21-
find_package(Qt4 REQUIRED)
22-
endif(o2_WITH_QT5)
23-
24-
if (NOT o2_WITH_QT5)
25-
include( ${QT_USE_FILE} )
26-
endif(NOT o2_WITH_QT5)
10+
if(o2_WITH_QT6)
11+
find_package(Qt6 COMPONENTS Core Widgets Network WebEngineCore WebEngineWidgets REQUIRED)
12+
else()
13+
find_package(Qt5 COMPONENTS Core Widgets Script Network WebEngine WebEngineWidgets REQUIRED)
14+
endif()
2715

2816
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" )
2917

@@ -34,15 +22,7 @@ set(msgraph_SRCS
3422
webenginepage.cpp
3523
)
3624

37-
if(NOT o2_WITH_QT5)
38-
add_definitions(${QT4_DEFINITIONS})
39-
endif(NOT o2_WITH_QT5)
40-
4125
add_executable( msgraphexternalinterceptorexample ${msgraph_SRCS} )
4226

43-
if(o2_WITH_QT5)
44-
target_link_libraries( msgraphexternalinterceptorexample Qt5::Core Qt5::Widgets Qt5::Network Qt5::WebEngine Qt5::WebEngineWidgets )
45-
target_link_libraries( msgraphexternalinterceptorexample o2 )
46-
else(o2_WITH_QT5)
47-
target_link_libraries( msgraphexternalinterceptorexample ${QT_LIBRARIES} o2 )
48-
endif(o2_WITH_QT5)
27+
target_link_libraries( msgraphexternalinterceptorexample Qt::Core Qt::Widgets Qt::Network Qt::WebEngineWidgets )
28+
target_link_libraries( msgraphexternalinterceptorexample o2 )

examples/twitterdemo/CMakeLists.txt

+7-25
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,20 @@ set(CMAKE_AUTOMOC ON)
66
set(CMAKE_INCLUDE_CURRENT_DIR ON)
77
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
88

9-
if(o2_WITH_QT5)
10-
# Qt5 packages find their own dependencies.
11-
find_package(Qt5Core REQUIRED)
12-
find_package(Qt5Widgets REQUIRED)
13-
find_package(Qt5Script REQUIRED)
14-
find_package(Qt5Network REQUIRED)
15-
else(o2_WITH_QT5)
16-
set(QT_USE_QTNETWORK true)
17-
set(QT_USE_QTSCRIPT true)
18-
find_package(Qt4 REQUIRED)
19-
endif(o2_WITH_QT5)
9+
if(o2_WITH_QT6)
10+
find_package(Qt6 COMPONENTS Core Widgets Network REQUIRED)
11+
else()
12+
find_package(Qt5 COMPONENTS Core Widgets Script Network REQUIRED)
13+
endif()
2014

21-
if (NOT o2_WITH_QT5)
22-
include( ${QT_USE_FILE} )
23-
endif(NOT o2_WITH_QT5)
24-
2515
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" )
2616

2717
set(fb_SRCS
2818
main.cpp
2919
tweeter.cpp
3020
)
3121

32-
if(NOT o2_WITH_QT5)
33-
add_definitions(${QT4_DEFINITIONS})
34-
endif(NOT o2_WITH_QT5)
35-
3622
add_executable( twitterexample ${fb_SRCS} )
3723

38-
if(o2_WITH_QT5)
39-
target_link_libraries( twitterexample Qt5::Core Qt5::Widgets Qt5::Network )
40-
target_link_libraries( twitterexample o2 )
41-
else(o2_WITH_QT5)
42-
target_link_libraries( twitterexample ${QT_LIBRARIES} o2 )
43-
endif(o2_WITH_QT5)
24+
target_link_libraries( twitterexample Qt::Core Qt::Widgets Qt::Network )
25+
target_link_libraries( twitterexample o2 )

0 commit comments

Comments
 (0)