Skip to content

Commit 9fc3e62

Browse files
cedrik-fuoco-adskrichardssam
authored andcommitted
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 - [ ] Rocky LInux 8 - [ ] MacOS attention during the review. --------- Signed-off-by: Cédrik Fuoco <[email protected]> Signed-off-by: [email protected] <[email protected]>
1 parent baf0ee0 commit 9fc3e62

File tree

545 files changed

+180413
-1334
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

+180413
-1334
lines changed

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ compile_commands.json
2525
**/.python-version
2626

2727
cmake-*/*
28-
/*build*/
28+
build/*
29+
_build*/*
2930
_install/*
3031
.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 & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -69,39 +69,13 @@ IF(RV_VFX_PLATFORM STREQUAL CY2024)
6969
ON
7070
)
7171
ADD_COMPILE_DEFINITIONS(RV_VFX_CY2024)
72-
SET(RV_QT_PACKAGE_NAME
73-
"Qt6"
74-
)
75-
SET(RV_QT_MU_TARGET
76-
"MuQt6"
77-
)
72+
SET(RV_QT_PACKAGE_NAME "Qt6")
73+
SET(RV_QT_MU_TARGET "MuQt6")
7874
ELSEIF(RV_VFX_PLATFORM STREQUAL CY2023)
7975
SET(RV_VFX_CY2023
8076
ON
8177
)
8278
ADD_COMPILE_DEFINITIONS(RV_VFX_CY2023)
83-
SET(RV_QT_PACKAGE_NAME
84-
"Qt5"
85-
)
86-
SET(RV_QT_MU_TARGET
87-
"MuQt5"
88-
)
89-
ENDIF()
90-
91-
#
92-
# FFmpeg option
93-
#
94-
95-
# Add preprocessor variable for use in code and cmake to determine the current version of FFmpeg. Current version must be one of the supported versions, as
96-
# defined in ffmpeg.cmake.
97-
IF(RV_FFMPEG STREQUAL 6)
98-
SET(RV_FFMPEG_6
99-
ON
100-
)
101-
ADD_COMPILE_DEFINITIONS(RV_FFMPEG_6)
102-
ELSEIF(RV_FFMPEG STREQUAL 7)
103-
SET(RV_FFMPEG_7
104-
ON
105-
)
106-
ADD_COMPILE_DEFINITIONS(RV_FFMPEG_7)
79+
SET(RV_QT_PACKAGE_NAME "Qt5")
80+
SET(RV_QT_MU_TARGET "MuQt5")
10781
ENDIF()

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)
@@ -122,8 +130,21 @@ IF(RV_TARGET_WINDOWS)
122130
ENDIF()
123131
MESSAGE(STATUS "Using PNG: ${RV_DEPS_PNG_VERSION}")
124132
MESSAGE(STATUS "Using Python3: ${RV_DEPS_PYTHON3_VERSION}")
125-
MESSAGE(STATUS "Using PySide2: ${RV_DEPS_PYSIDE2_VERSION}")
126-
MESSAGE(STATUS "Using Qt5: ${RV_DEPS_QT5_VERSION}")
133+
134+
RV_VFX_SET_VARIABLE(
135+
_rv_deps_pyside_version
136+
CY2023 "Using PySide2: ${RV_DEPS_PYSIDE_VERSION}"
137+
CY2024 "Using PySide6: ${RV_DEPS_PYSIDE_VERSION}"
138+
)
139+
MESSAGE(STATUS "${_rv_deps_pyside_version}")
140+
141+
RV_VFX_SET_VARIABLE(
142+
_rv_deps_qt_version
143+
CY2023 "Using Qt5: ${RV_DEPS_QT5_VERSION}"
144+
CY2024 "Using Qt6: ${RV_DEPS_QT6_VERSION}"
145+
)
146+
MESSAGE(STATUS "${_rv_deps_qt_version}")
147+
127148
MESSAGE(STATUS "Using Raw: ${RV_DEPS_RAW_VERSION}")
128149
MESSAGE(STATUS "Using Tiff: ${RV_DEPS_TIFF_VERSION}")
129150
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: 118 additions & 52 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
@@ -40,9 +43,9 @@ SET(_opentimelineio_version
4043
)
4144

4245
RV_VFX_SET_VARIABLE(
43-
_pyside2_version CY2023 "5.15.10"
44-
# Need 5.15.11+ to support Python 3.11.
45-
CY2024 "5.15.11"
46+
_pyside_version
47+
CY2023 "5.15.10"
48+
CY2024 "6.5.3"
4649
)
4750

4851
SET(_python3_download_url
@@ -57,10 +60,17 @@ SET(_opentimelineio_git_tag
5760
"v${_opentimelineio_version}"
5861
)
5962

60-
SET(_pyside2_archive_url
61-
"https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside2/PySide2-${_pyside2_version}-src/pyside-setup-opensource-src-${_pyside2_version}.zip"
63+
RV_VFX_SET_VARIABLE(
64+
_pyside_archive_url
65+
CY2023 "https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside2/PySide2-${_pyside_version}-src/pyside-setup-opensource-src-${_pyside_version}.zip"
66+
CY2024 "https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside6/PySide6-${_pyside_version}-src/pyside-setup-everywhere-src-${_pyside_version}.zip"
67+
)
68+
69+
RV_VFX_SET_VARIABLE(
70+
_pyside_download_hash
71+
CY2023 "87841aaced763b6b52e9b549e31a493f"
72+
CY2024 "515d3249c6e743219ff0d7dd25b8c8d8"
6273
)
63-
RV_VFX_SET_VARIABLE(_pyside2_download_hash CY2023 "87841aaced763b6b52e9b549e31a493f" CY2024 "8f652b08c1c74f9a80a2c0f16ff2a4ca")
6474

6575
SET(_install_dir
6676
${RV_DEPS_BASE_DIR}/${_python3_target}/install
@@ -86,13 +96,13 @@ IF(RV_TARGET_WINDOWS)
8696
ENDIF()
8797

8898
FETCHCONTENT_DECLARE(
89-
${_pyside2_target}
90-
URL ${_pyside2_archive_url}
91-
URL_HASH MD5=${_pyside2_download_hash}
99+
${_pyside_target}
100+
URL ${_pyside_archive_url}
101+
URL_HASH MD5=${_pyside_download_hash}
92102
SOURCE_SUBDIR "sources" # Avoids the top level CMakeLists.txt
93103
)
94104

95-
FETCHCONTENT_MAKEAVAILABLE(${_pyside2_target})
105+
FETCHCONTENT_MAKEAVAILABLE(${_pyside_target})
96106

97107
SET(_python3_make_command_script
98108
"${PROJECT_SOURCE_DIR}/src/build/make_python.py"
@@ -119,30 +129,67 @@ IF(RV_TARGET_WINDOWS)
119129
LIST(APPEND _python3_make_command "${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
120130
ENDIF()
121131

122-
SET(_pyside2_make_command_script
123-
"${PROJECT_SOURCE_DIR}/src/build/make_pyside.py"
124-
)
125-
SET(_pyside2_make_command
126-
python3 "${_pyside2_make_command_script}"
127-
)
128-
LIST(APPEND _pyside2_make_command "--variant")
129-
LIST(APPEND _pyside2_make_command ${CMAKE_BUILD_TYPE})
130-
LIST(APPEND _pyside2_make_command "--source-dir")
131-
LIST(APPEND _pyside2_make_command ${rv_deps_pyside2_SOURCE_DIR})
132-
LIST(APPEND _pyside2_make_command "--output-dir")
133-
LIST(APPEND _pyside2_make_command ${_install_dir})
134-
LIST(APPEND _pyside2_make_command "--temp-dir")
135-
LIST(APPEND _pyside2_make_command ${_build_dir})
136-
IF(DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
137-
LIST(APPEND _pyside2_make_command "--openssl-dir")
138-
LIST(APPEND _pyside2_make_command ${RV_DEPS_OPENSSL_INSTALL_DIR})
132+
133+
# TODO_QT: Maybe we could use something like NOT CY2023
134+
# since after 2023, it is Qt6
135+
# TODO_QT: Below code could be simplified, but for now it is faster to test.
136+
IF(RV_VFX_PLATFORM STREQUAL CY2023)
137+
SET(_pyside_make_command_script
138+
"${PROJECT_SOURCE_DIR}/src/build/make_pyside.py"
139+
)
140+
SET(_pyside_make_command
141+
python3 "${_pyside_make_command_script}"
142+
)
143+
144+
LIST(APPEND _pyside_make_command "--variant")
145+
LIST(APPEND _pyside_make_command ${CMAKE_BUILD_TYPE})
146+
LIST(APPEND _pyside_make_command "--source-dir")
147+
LIST(APPEND _pyside_make_command ${rv_deps_pyside2_SOURCE_DIR})
148+
LIST(APPEND _pyside_make_command "--output-dir")
149+
LIST(APPEND _pyside_make_command ${_install_dir})
150+
LIST(APPEND _pyside_make_command "--temp-dir")
151+
LIST(APPEND _pyside_make_command ${_build_dir})
152+
153+
IF(DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
154+
LIST(APPEND _pyside_make_command "--openssl-dir")
155+
LIST(APPEND _pyside_make_command ${RV_DEPS_OPENSSL_INSTALL_DIR})
156+
ENDIF()
157+
158+
LIST(APPEND _pyside_make_command "--python-dir")
159+
LIST(APPEND _pyside_make_command ${_install_dir})
160+
LIST(APPEND _pyside_make_command "--qt-dir")
161+
LIST(APPEND _pyside_make_command ${RV_DEPS_QT5_LOCATION})
162+
LIST(APPEND _pyside_make_command "--python-version")
163+
LIST(APPEND _pyside_make_command "${RV_DEPS_PYTHON_VERSION_SHORT}")
164+
ELSEIF(RV_VFX_PLATFORM STREQUAL CY2024)
165+
SET(_pyside_make_command_script
166+
"${PROJECT_SOURCE_DIR}/src/build/make_pyside6.py"
167+
)
168+
SET(_pyside_make_command
169+
python3 "${_pyside_make_command_script}"
170+
)
171+
172+
LIST(APPEND _pyside_make_command "--variant")
173+
LIST(APPEND _pyside_make_command ${CMAKE_BUILD_TYPE})
174+
LIST(APPEND _pyside_make_command "--source-dir")
175+
LIST(APPEND _pyside_make_command ${rv_deps_pyside6_SOURCE_DIR})
176+
LIST(APPEND _pyside_make_command "--output-dir")
177+
LIST(APPEND _pyside_make_command ${_install_dir})
178+
LIST(APPEND _pyside_make_command "--temp-dir")
179+
LIST(APPEND _pyside_make_command ${_build_dir})
180+
181+
IF(DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
182+
LIST(APPEND _pyside_make_command "--openssl-dir")
183+
LIST(APPEND _pyside_make_command ${RV_DEPS_OPENSSL_INSTALL_DIR})
184+
ENDIF()
185+
186+
LIST(APPEND _pyside_make_command "--python-dir")
187+
LIST(APPEND _pyside_make_command ${_install_dir})
188+
LIST(APPEND _pyside_make_command "--qt-dir")
189+
LIST(APPEND _pyside_make_command ${RV_DEPS_QT6_LOCATION})
190+
LIST(APPEND _pyside_make_command "--python-version")
191+
LIST(APPEND _pyside_make_command "${RV_DEPS_PYTHON_VERSION_SHORT}")
139192
ENDIF()
140-
LIST(APPEND _pyside2_make_command "--python-dir")
141-
LIST(APPEND _pyside2_make_command ${_install_dir})
142-
LIST(APPEND _pyside2_make_command "--qt-dir")
143-
LIST(APPEND _pyside2_make_command ${RV_DEPS_QT5_LOCATION})
144-
LIST(APPEND _pyside2_make_command "--python-version")
145-
LIST(APPEND _pyside2_make_command "${RV_DEPS_PYTHON_VERSION_SHORT}")
146193

147194
IF(RV_TARGET_WINDOWS)
148195
IF(CMAKE_BUILD_TYPE MATCHES "^Debug$")
@@ -279,21 +326,40 @@ IF(RV_TARGET_WINDOWS
279326
)
280327
ENDIF()
281328

282-
SET(${_pyside2_target}-build-flag
283-
${_install_dir}/${_pyside2_target}-build-flag
329+
SET(${_pyside_target}-build-flag
330+
${_install_dir}/${_pyside_target}-build-flag
284331
)
285332

286-
ADD_CUSTOM_COMMAND(
287-
COMMENT "Building PySide2 using ${_pyside2_make_command_script}"
288-
OUTPUT ${${_pyside2_target}-build-flag}
289-
# First PySide build script on Windows which doesn't respect '--debug' option
290-
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/src/build/patch_PySide2/windows_desktop.py
291-
${rv_deps_pyside2_SOURCE_DIR}/build_scripts/platforms/windows_desktop.py
292-
COMMAND ${_pyside2_make_command} --prepare --build
293-
COMMAND cmake -E touch ${${_pyside2_target}-build-flag}
294-
DEPENDS ${_python3_target} ${_pyside2_make_command_script} ${${_python3_target}-requirements-flag}
295-
USES_TERMINAL
296-
)
333+
334+
# TODO_QT: Maybe we could use something like NOT CY2023
335+
# since after 2023, it is Qt6
336+
# TODO_QT: Below code could be simplified, but for now it is faster to test.
337+
IF(RV_VFX_PLATFORM STREQUAL CY2023)
338+
ADD_CUSTOM_COMMAND(
339+
COMMENT "Building PySide2 using ${_pyside_make_command_script}"
340+
OUTPUT ${${_pyside_target}-build-flag}
341+
# First PySide build script on Windows which doesn't respect '--debug' option
342+
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/src/build/patch_PySide2/windows_desktop.py
343+
${rv_deps_pyside2_SOURCE_DIR}/build_scripts/platforms/windows_desktop.py
344+
COMMAND ${_pyside_make_command} --prepare --build
345+
COMMAND cmake -E touch ${${_pyside_target}-build-flag}
346+
DEPENDS ${_python3_target} ${_pyside_make_command_script} ${${_python3_target}-requirements-flag}
347+
USES_TERMINAL
348+
)
349+
350+
SET(_build_flag_depends ${${_pyside_target}-build-flag})
351+
ELSEIF(RV_VFX_PLATFORM STREQUAL CY2024)
352+
ADD_CUSTOM_COMMAND(
353+
COMMENT "Building PySide6 using ${_pyside_make_command_script}"
354+
OUTPUT ${${_pyside_target}-build-flag}
355+
COMMAND ${_pyside_make_command} --prepare --build
356+
COMMAND cmake -E touch ${${_pyside_target}-build-flag}
357+
DEPENDS ${_python3_target} ${_pyside_make_command_script} ${${_python3_target}-requirements-flag}
358+
USES_TERMINAL
359+
)
360+
361+
SET(_build_flag_depends ${${_pyside_target}-build-flag})
362+
ENDIF()
297363

298364
IF(RV_TARGET_WINDOWS)
299365
ADD_CUSTOM_COMMAND(
@@ -302,7 +368,7 @@ IF(RV_TARGET_WINDOWS)
302368
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/lib ${RV_STAGE_LIB_DIR}
303369
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/include ${RV_STAGE_INCLUDE_DIR}
304370
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/bin ${RV_STAGE_BIN_DIR}
305-
DEPENDS ${_python3_target} ${${_pyside2_target}-build-flag} ${${_python3_target}-requirements-flag}
371+
DEPENDS ${_python3_target} ${${_python3_target}-requirements-flag} ${_build_flag_depends}
306372
)
307373
ADD_CUSTOM_TARGET(
308374
${_python3_target}-stage-target ALL
@@ -315,7 +381,7 @@ ELSE()
315381
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/lib ${RV_STAGE_LIB_DIR}
316382
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/include ${RV_STAGE_INCLUDE_DIR}
317383
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/bin ${RV_STAGE_BIN_DIR}
318-
DEPENDS ${_python3_target} ${${_pyside2_target}-build-flag} ${${_python3_target}-requirements-flag}
384+
DEPENDS ${_python3_target} ${${_python3_target}-requirements-flag} ${_build_flag_depends}
319385
)
320386
ADD_CUSTOM_TARGET(
321387
${_python3_target}-stage-target ALL
@@ -352,8 +418,8 @@ SET(RV_DEPS_PYTHON3_VERSION
352418
${_python3_version}
353419
CACHE INTERNAL "" FORCE
354420
)
355-
SET(RV_DEPS_PYSIDE2_VERSION
356-
${_pyside2_version}
421+
SET(RV_DEPS_PYSIDE_VERSION
422+
${_pyside_version}
357423
CACHE INTERNAL "" FORCE
358424
)
359425

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)