Skip to content

Commit b69531a

Browse files
Feature - Qt 6 port #1 (AcademySoftwareFoundation#606)
### Feature - Qt 6 port # 1 ### Linked issues AcademySoftwareFoundation#367 ### Summarize your change. This is the first phase of the Qt 6 port. It was mostly tested on Rocky Linux 8. There are a lot of generated files under `src/lib/mu/MuQt6`, and some modifications but you don't need to go over that folder. There are known issues that will be addressed in future PR: **All platforms:** - Refactor _QtAudioRenderer_ class. Currently, The _pulse_ audio output device is not enabled, and they are loud white noise issues on MacOS. - Remove the usage of _Core5compat_ and refactor what is deprecated. I don't think there is a lot to do here, but it is mostly about refactor the usage of _QTextCodec_. **MacOS:** - The _Open File dialog_ does not open anymore. - Loud white noise audio (Should be related to _QtAudioRenderer_) - The Central widget is rendered in the bottom left corner, but as soon as you resize the windows, it goes back to normal. **Windows:** - Issue with the compilation of Shiboken6 ### Describe what you have tested and on which operating system. - [ ] Rocky LInux 8 - [ ] MacOS ### Add a list of changes, and note any that might need special attention during the review. --------- Signed-off-by: Cédrik Fuoco <[email protected]>
1 parent db17195 commit b69531a

File tree

545 files changed

+174569
-642
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

545 files changed

+174569
-642
lines changed

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ compile_commands.json
2626

2727
cmake-*/*
2828
build/*
29-
_build/*
29+
_build*/*
3030
_install/*
3131
.venv/*
32+
33+
# These are now generated by CMake using template to support Qt5 and Qt6.
34+
# See rvui.mu.in
35+
rvui.mu
36+
# See window_mode.mu.in
37+
window_mode.mu
38+
# See session_manager.mu.in
39+
session_manager.mu

.gitmodules

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
url = https://github.com/shotgunsoftware/openrv-WFObj.git
44
[submodule "src/pub"]
55
path = src/pub
6-
url = https://github.com/shotgunsoftware/openrv-pub.git
6+
url = [email protected]:cedrik-fuoco-adsk/openrv-pub.git
7+
branch = qt6

cmake/defaults/cxx_defaults.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,13 @@ ENDIF()
6868
IF(RV_VFX_PLATFORM STREQUAL CY2024)
6969
SET(RV_VFX_CY2024 ON)
7070
ADD_COMPILE_DEFINITIONS(RV_VFX_CY2024)
71+
SET(RV_QT_PACKAGE_NAME "Qt6")
72+
SET(RV_QT_MU_TARGET "MuQt6")
7173
ELSEIF(RV_VFX_PLATFORM STREQUAL CY2023)
7274
SET(RV_VFX_CY2023 ON)
7375
ADD_COMPILE_DEFINITIONS(RV_VFX_CY2023)
76+
SET(RV_QT_PACKAGE_NAME "Qt5")
77+
SET(RV_QT_MU_TARGET "MuQt5")
7478
ENDIF()
7579

7680
#

cmake/defaults/rv_options.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ SET(RV_VFX_PLATFORM
7575
"${_RV_VFX_PLATFORM}"
7676
CACHE STRING "Set the VFX platform for installaing external dependencies" FORCE
7777
)
78+
7879
SET_PROPERTY(
7980
CACHE RV_VFX_PLATFORM
8081
PROPERTY STRINGS ${_RV_VFX_PLATFORM}

cmake/dependencies/CMakeLists.txt

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,15 @@ ENDIF()
4545
IF(RV_TARGET_WINDOWS)
4646
INCLUDE(expat)
4747
ENDIF()
48-
INCLUDE(qt5)
48+
49+
# TODO_QT: Not generic enough.. But maybe we could use something like NOT CY2023
50+
# since after 2023, it is Qt6
51+
IF(RV_VFX_PLATFORM STREQUAL CY2023)
52+
INCLUDE(qt5)
53+
ELSEIF(RV_VFX_PLATFORM STREQUAL CY2024)
54+
INCLUDE(qt6)
55+
ENDIF()
56+
4957
INCLUDE(openssl) # Python3 requirement
5058
INCLUDE(python3)
5159
INCLUDE(boost)
@@ -120,8 +128,21 @@ IF(RV_TARGET_WINDOWS)
120128
ENDIF()
121129
MESSAGE(STATUS "Using PNG: ${RV_DEPS_PNG_VERSION}")
122130
MESSAGE(STATUS "Using Python3: ${RV_DEPS_PYTHON3_VERSION}")
123-
MESSAGE(STATUS "Using PySide2: ${RV_DEPS_PYSIDE2_VERSION}")
124-
MESSAGE(STATUS "Using Qt5: ${RV_DEPS_QT5_VERSION}")
131+
132+
RV_VFX_SET_VARIABLE(
133+
_rv_deps_pyside_version
134+
CY2023 "Using PySide2: ${RV_DEPS_PYSIDE_VERSION}"
135+
CY2024 "Using PySide6: ${RV_DEPS_PYSIDE_VERSION}"
136+
)
137+
MESSAGE(STATUS "${_rv_deps_pyside_version}")
138+
139+
RV_VFX_SET_VARIABLE(
140+
_rv_deps_qt_version
141+
CY2023 "Using Qt5: ${RV_DEPS_QT5_VERSION}"
142+
CY2024 "Using Qt6: ${RV_DEPS_QT6_VERSION}"
143+
)
144+
MESSAGE(STATUS "${_rv_deps_qt_version}")
145+
125146
MESSAGE(STATUS "Using Raw: ${RV_DEPS_RAW_VERSION}")
126147
MESSAGE(STATUS "Using Tiff: ${RV_DEPS_TIFF_VERSION}")
127148
MESSAGE(STATUS "Using WebP: ${RV_DEPS_WEBP_VERSION}")

cmake/dependencies/oiio.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ ENDIF()
130130

131131
LIST(APPEND _configure_options "-DLibRaw_ROOT=${RV_DEPS_RAW_ROOT_DIR}")
132132

133-
LIST(APPEND _configure_options "-DQt5_ROOT=${RV_DEPS_QT5_LOCATION}")
134-
135133
IF(NOT RV_TARGET_LINUX)
136134
LIST(APPEND _configure_options "-DWebP_ROOT=${RV_DEPS_WEBP_ROOT_DIR}")
137135
# Linux has a Link error related to relocation; WebP appears not built with -fPIC. Hence OIIO will build WebP itself.

cmake/dependencies/python3.cmake

Lines changed: 114 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# SPDX-License-Identifier: Apache-2.0
55
#
66

7+
78
SET(_python3_target
89
"RV_DEPS_PYTHON3"
910
)
@@ -12,8 +13,10 @@ SET(_opentimelineio_target
1213
"RV_DEPS_OPENTIMELINEIO"
1314
)
1415

15-
SET(_pyside2_target
16-
"RV_DEPS_PYSIDE2"
16+
RV_VFX_SET_VARIABLE(
17+
_pyside_target
18+
CY2023 "RV_DEPS_PYSIDE2"
19+
CY2024 "RV_DEPS_PYSIDE6"
1720
)
1821

1922
SET(PYTHON_VERSION_MAJOR
@@ -48,10 +51,9 @@ SET(_opentimelineio_version
4851
)
4952

5053
RV_VFX_SET_VARIABLE(
51-
_pyside2_version
54+
_pyside_version
5255
CY2023 "5.15.10"
53-
# Need 5.15.11+ to support Python 3.11.
54-
CY2024 "5.15.11"
56+
CY2024 "6.5.3"
5557
)
5658

5759
SET(_python3_download_url
@@ -70,13 +72,16 @@ SET(_opentimelineio_git_tag
7072
"v${_opentimelineio_version}"
7173
)
7274

73-
SET(_pyside2_archive_url
74-
"https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside2/PySide2-${_pyside2_version}-src/pyside-setup-opensource-src-${_pyside2_version}.zip"
75+
RV_VFX_SET_VARIABLE(
76+
_pyside_archive_url
77+
CY2023 "https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside2/PySide2-${_pyside_version}-src/pyside-setup-opensource-src-${_pyside_version}.zip"
78+
CY2024 "https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside6/PySide6-${_pyside_version}-src/pyside-setup-everywhere-src-${_pyside_version}.zip"
7579
)
80+
7681
RV_VFX_SET_VARIABLE(
77-
_pyside2_download_hash
82+
_pyside_download_hash
7883
CY2023 "87841aaced763b6b52e9b549e31a493f"
79-
CY2024 "8f652b08c1c74f9a80a2c0f16ff2a4ca"
84+
CY2024 "515d3249c6e743219ff0d7dd25b8c8d8"
8085
)
8186

8287
SET(_install_dir
@@ -103,13 +108,13 @@ IF(RV_TARGET_WINDOWS)
103108
ENDIF()
104109

105110
FETCHCONTENT_DECLARE(
106-
${_pyside2_target}
107-
URL ${_pyside2_archive_url}
108-
URL_HASH MD5=${_pyside2_download_hash}
111+
${_pyside_target}
112+
URL ${_pyside_archive_url}
113+
URL_HASH MD5=${_pyside_download_hash}
109114
SOURCE_SUBDIR "sources" # Avoids the top level CMakeLists.txt
110115
)
111116

112-
FETCHCONTENT_MAKEAVAILABLE(${_pyside2_target})
117+
FETCHCONTENT_MAKEAVAILABLE(${_pyside_target})
113118

114119
SET(_python3_make_command_script
115120
"${PROJECT_SOURCE_DIR}/src/build/make_python.py"
@@ -136,30 +141,67 @@ IF(RV_TARGET_WINDOWS)
136141
LIST(APPEND _python3_make_command "${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
137142
ENDIF()
138143

139-
SET(_pyside2_make_command_script
140-
"${PROJECT_SOURCE_DIR}/src/build/make_pyside.py"
141-
)
142-
SET(_pyside2_make_command
143-
python3 "${_pyside2_make_command_script}"
144-
)
145-
LIST(APPEND _pyside2_make_command "--variant")
146-
LIST(APPEND _pyside2_make_command ${CMAKE_BUILD_TYPE})
147-
LIST(APPEND _pyside2_make_command "--source-dir")
148-
LIST(APPEND _pyside2_make_command ${rv_deps_pyside2_SOURCE_DIR})
149-
LIST(APPEND _pyside2_make_command "--output-dir")
150-
LIST(APPEND _pyside2_make_command ${_install_dir})
151-
LIST(APPEND _pyside2_make_command "--temp-dir")
152-
LIST(APPEND _pyside2_make_command ${_build_dir})
153-
IF(DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
154-
LIST(APPEND _pyside2_make_command "--openssl-dir")
155-
LIST(APPEND _pyside2_make_command ${RV_DEPS_OPENSSL_INSTALL_DIR})
144+
145+
# TODO_QT: Maybe we could use something like NOT CY2023
146+
# since after 2023, it is Qt6
147+
# TODO_QT: Below code could be simplified, but for now it is faster to test.
148+
IF(RV_VFX_PLATFORM STREQUAL CY2023)
149+
SET(_pyside_make_command_script
150+
"${PROJECT_SOURCE_DIR}/src/build/make_pyside.py"
151+
)
152+
SET(_pyside_make_command
153+
python3 "${_pyside_make_command_script}"
154+
)
155+
156+
LIST(APPEND _pyside_make_command "--variant")
157+
LIST(APPEND _pyside_make_command ${CMAKE_BUILD_TYPE})
158+
LIST(APPEND _pyside_make_command "--source-dir")
159+
LIST(APPEND _pyside_make_command ${rv_deps_pyside2_SOURCE_DIR})
160+
LIST(APPEND _pyside_make_command "--output-dir")
161+
LIST(APPEND _pyside_make_command ${_install_dir})
162+
LIST(APPEND _pyside_make_command "--temp-dir")
163+
LIST(APPEND _pyside_make_command ${_build_dir})
164+
165+
IF(DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
166+
LIST(APPEND _pyside_make_command "--openssl-dir")
167+
LIST(APPEND _pyside_make_command ${RV_DEPS_OPENSSL_INSTALL_DIR})
168+
ENDIF()
169+
170+
LIST(APPEND _pyside_make_command "--python-dir")
171+
LIST(APPEND _pyside_make_command ${_install_dir})
172+
LIST(APPEND _pyside_make_command "--qt-dir")
173+
LIST(APPEND _pyside_make_command ${RV_DEPS_QT5_LOCATION})
174+
LIST(APPEND _pyside_make_command "--python-version")
175+
LIST(APPEND _pyside_make_command "${RV_DEPS_PYTHON_VERSION_SHORT}")
176+
ELSEIF(RV_VFX_PLATFORM STREQUAL CY2024)
177+
SET(_pyside_make_command_script
178+
"${PROJECT_SOURCE_DIR}/src/build/make_pyside6.py"
179+
)
180+
SET(_pyside_make_command
181+
python3 "${_pyside_make_command_script}"
182+
)
183+
184+
LIST(APPEND _pyside_make_command "--variant")
185+
LIST(APPEND _pyside_make_command ${CMAKE_BUILD_TYPE})
186+
LIST(APPEND _pyside_make_command "--source-dir")
187+
LIST(APPEND _pyside_make_command ${rv_deps_pyside6_SOURCE_DIR})
188+
LIST(APPEND _pyside_make_command "--output-dir")
189+
LIST(APPEND _pyside_make_command ${_install_dir})
190+
LIST(APPEND _pyside_make_command "--temp-dir")
191+
LIST(APPEND _pyside_make_command ${_build_dir})
192+
193+
IF(DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
194+
LIST(APPEND _pyside_make_command "--openssl-dir")
195+
LIST(APPEND _pyside_make_command ${RV_DEPS_OPENSSL_INSTALL_DIR})
196+
ENDIF()
197+
198+
LIST(APPEND _pyside_make_command "--python-dir")
199+
LIST(APPEND _pyside_make_command ${_install_dir})
200+
LIST(APPEND _pyside_make_command "--qt-dir")
201+
LIST(APPEND _pyside_make_command ${RV_DEPS_QT6_LOCATION})
202+
LIST(APPEND _pyside_make_command "--python-version")
203+
LIST(APPEND _pyside_make_command "${RV_DEPS_PYTHON_VERSION_SHORT}")
156204
ENDIF()
157-
LIST(APPEND _pyside2_make_command "--python-dir")
158-
LIST(APPEND _pyside2_make_command ${_install_dir})
159-
LIST(APPEND _pyside2_make_command "--qt-dir")
160-
LIST(APPEND _pyside2_make_command ${RV_DEPS_QT5_LOCATION})
161-
LIST(APPEND _pyside2_make_command "--python-version")
162-
LIST(APPEND _pyside2_make_command "${RV_DEPS_PYTHON_VERSION_SHORT}")
163205

164206
IF(RV_TARGET_WINDOWS)
165207
IF(CMAKE_BUILD_TYPE MATCHES "^Debug$")
@@ -297,21 +339,40 @@ IF(RV_TARGET_WINDOWS
297339
)
298340
ENDIF()
299341

300-
SET(${_pyside2_target}-build-flag
301-
${_install_dir}/${_pyside2_target}-build-flag
342+
SET(${_pyside_target}-build-flag
343+
${_install_dir}/${_pyside_target}-build-flag
302344
)
303345

304-
ADD_CUSTOM_COMMAND(
305-
COMMENT "Building PySide2 using ${_pyside2_make_command_script}"
306-
OUTPUT ${${_pyside2_target}-build-flag}
307-
# First PySide build script on Windows which doesn't respect '--debug' option
308-
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/src/build/patch_PySide2/windows_desktop.py
309-
${rv_deps_pyside2_SOURCE_DIR}/build_scripts/platforms/windows_desktop.py
310-
COMMAND ${_pyside2_make_command} --prepare --build
311-
COMMAND cmake -E touch ${${_pyside2_target}-build-flag}
312-
DEPENDS ${_python3_target} ${_pyside2_make_command_script} ${${_python3_target}-requirements-flag}
313-
USES_TERMINAL
314-
)
346+
347+
# TODO_QT: Maybe we could use something like NOT CY2023
348+
# since after 2023, it is Qt6
349+
# TODO_QT: Below code could be simplified, but for now it is faster to test.
350+
IF(RV_VFX_PLATFORM STREQUAL CY2023)
351+
ADD_CUSTOM_COMMAND(
352+
COMMENT "Building PySide2 using ${_pyside_make_command_script}"
353+
OUTPUT ${${_pyside_target}-build-flag}
354+
# First PySide build script on Windows which doesn't respect '--debug' option
355+
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/src/build/patch_PySide2/windows_desktop.py
356+
${rv_deps_pyside2_SOURCE_DIR}/build_scripts/platforms/windows_desktop.py
357+
COMMAND ${_pyside_make_command} --prepare --build
358+
COMMAND cmake -E touch ${${_pyside_target}-build-flag}
359+
DEPENDS ${_python3_target} ${_pyside_make_command_script} ${${_python3_target}-requirements-flag}
360+
USES_TERMINAL
361+
)
362+
363+
SET(_build_flag_depends ${${_pyside_target}-build-flag})
364+
ELSEIF(RV_VFX_PLATFORM STREQUAL CY2024)
365+
ADD_CUSTOM_COMMAND(
366+
COMMENT "Building PySide6 using ${_pyside_make_command_script}"
367+
OUTPUT ${${_pyside_target}-build-flag}
368+
COMMAND ${_pyside_make_command} --prepare --build
369+
COMMAND cmake -E touch ${${_pyside_target}-build-flag}
370+
DEPENDS ${_python3_target} ${_pyside_make_command_script} ${${_python3_target}-requirements-flag}
371+
USES_TERMINAL
372+
)
373+
374+
SET(_build_flag_depends ${${_pyside_target}-build-flag})
375+
ENDIF()
315376

316377
IF(RV_TARGET_WINDOWS)
317378
ADD_CUSTOM_COMMAND(
@@ -320,7 +381,7 @@ IF(RV_TARGET_WINDOWS)
320381
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/lib ${RV_STAGE_LIB_DIR}
321382
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/include ${RV_STAGE_INCLUDE_DIR}
322383
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/bin ${RV_STAGE_BIN_DIR}
323-
DEPENDS ${_python3_target} ${${_pyside2_target}-build-flag} ${${_python3_target}-requirements-flag}
384+
DEPENDS ${_python3_target} ${${_python3_target}-requirements-flag} ${_build_flag_depends}
324385
)
325386
ADD_CUSTOM_TARGET(
326387
${_python3_target}-stage-target ALL
@@ -333,7 +394,7 @@ ELSE()
333394
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/lib ${RV_STAGE_LIB_DIR}
334395
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/include ${RV_STAGE_INCLUDE_DIR}
335396
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/bin ${RV_STAGE_BIN_DIR}
336-
DEPENDS ${_python3_target} ${${_pyside2_target}-build-flag} ${${_python3_target}-requirements-flag}
397+
DEPENDS ${_python3_target} ${${_python3_target}-requirements-flag} ${_build_flag_depends}
337398
)
338399
ADD_CUSTOM_TARGET(
339400
${_python3_target}-stage-target ALL
@@ -370,8 +431,8 @@ SET(RV_DEPS_PYTHON3_VERSION
370431
${_python3_version}
371432
CACHE INTERNAL "" FORCE
372433
)
373-
SET(RV_DEPS_PYSIDE2_VERSION
374-
${_pyside2_version}
434+
SET(RV_DEPS_PYSIDE_VERSION
435+
${_pyside_version}
375436
CACHE INTERNAL "" FORCE
376437
)
377438

cmake/dependencies/qt5.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ FIND_PACKAGE(
5353
REQUIRED
5454
)
5555

56+
get_target_property(MOC_EXECUTABLE Qt5::moc IMPORTED_LOCATION)
57+
get_target_property(UIC_EXECUTABLE Qt5::uic IMPORTED_LOCATION)
58+
59+
SET(QT_MOC_EXECUTABLE "${MOC_EXECUTABLE}" CACHE STRING "Qt MOC executable")
60+
SET(QT_UIC_EXECUTABLE "${UIC_EXECUTABLE}" CACHE STRING "Qt UIC executable")
61+
5662
SET(_qt_copy_message
5763
"Copying Qt into ${RV_STAGE_ROOT_DIR}"
5864
)

0 commit comments

Comments
 (0)