Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - Qt 6 port #1 #606

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6b16b28
rvprof
cedrik-fuoco-adsk Sep 9, 2024
619030b
Changing QGLWidget to QOpenGLWidget
cedrik-fuoco-adsk Sep 12, 2024
91fb787
RvSession initialization changed and showing widget earlier
cedrik-fuoco-adsk Sep 19, 2024
e2d9ccf
GLFBO fix, can now render into the default framebuffer
cedrik-fuoco-adsk Sep 25, 2024
7b8ca36
Fix compilations issues on Windows and call glewInit when we are sure…
cedrik-fuoco-adsk Sep 26, 2024
a549189
Fix issue on MacOS, set OpenGL version to 2.1 for now, and clean up
cedrik-fuoco-adsk Sep 30, 2024
4a1e15c
Refactoring usage of QApplication::desktop() and QDesktopWidget
cedrik-fuoco-adsk Oct 1, 2024
f689757
QRegExp to QRegularExpression
cedrik-fuoco-adsk Oct 2, 2024
7564ead
Allow qt5 and qt6 at the same time
cedrik-fuoco-adsk Oct 7, 2024
43314ca
QElapsedTimer refactor
cedrik-fuoco-adsk Oct 7, 2024
5477b0a
Refactor delta function usage
cedrik-fuoco-adsk Oct 7, 2024
cc618d6
Refactor some QString enum that moved. Same in 5.15 and 6
cedrik-fuoco-adsk Oct 7, 2024
89fddad
Refactor QTAudioRenderer with supports for less sample size and type.…
cedrik-fuoco-adsk Oct 7, 2024
5095bc9
Allow qt5 and qt6 at the same time #2
cedrik-fuoco-adsk Oct 9, 2024
dca066b
Copy MuQt5 into MuQt6 and delete generated files.
cedrik-fuoco-adsk Oct 9, 2024
96e1873
Changes to support MuQt5 and MuQt6 at the same time. Not generated yet.
cedrik-fuoco-adsk Oct 9, 2024
a79eb0d
First pass of MuQt6 generations, not compiled yet
cedrik-fuoco-adsk Oct 9, 2024
bc28471
Second pass Mu bindings
cedrik-fuoco-adsk Oct 16, 2024
1a061f4
Mu binding generation and various fix
cedrik-fuoco-adsk Oct 17, 2024
9aa6882
handrolling QProcess::startDetatch
cedrik-fuoco-adsk Oct 17, 2024
cd147ca
Refactor PySide naming, fixing pyside6 compilation and adding missing…
cedrik-fuoco-adsk Oct 17, 2024
b06a990
Allow the usage for Qt5 and Qt6 at the same time in a few Mu script, …
cedrik-fuoco-adsk Oct 17, 2024
2453159
Allow pyside2 and pyside6 in python scripts
cedrik-fuoco-adsk Oct 18, 2024
eaf120c
Various fix to allow Qt5 and Qt6
cedrik-fuoco-adsk Oct 18, 2024
cff8192
Update pub to custom branch for now
cedrik-fuoco-adsk Oct 18, 2024
d8269b2
Revert unwanted changes
cedrik-fuoco-adsk Oct 18, 2024
d59dc76
Fix issues for MacOS and Windows
cedrik-fuoco-adsk Oct 18, 2024
7bb96fc
Fix indentation in test_SSL.py
cedrik-fuoco-adsk Oct 19, 2024
541b579
Fix transition from QApplication::desktop() to QScreen for Qt5 and Qt6
cedrik-fuoco-adsk Oct 21, 2024
41ce483
Tentative fix issue with qt5 uic and moc
cedrik-fuoco-adsk Oct 21, 2024
b6c6ae7
fix issue based on review comment
cedrik-fuoco-adsk Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ jobs:

- name: Install Homebrew dependencies
run: |
brew install --quiet --formula cmake ninja readline sqlite3 xz zlib tcl-tk autoconf automake libtool python yasm clang-format black meson nasm pkg-config glew
brew install --quiet --formula cmake ninja readline sqlite3 xz zlib tcl-tk autoconf automake libtool python yasm clang-format black meson nasm pkg-config glew icu4c

- name: Set QT_HOME
if: matrix.arch-type == 'x86_64'
Expand Down
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ compile_commands.json

cmake-*/*
build/*
_build/*
_build*/*
_install/*
.venv/*

# These are now generated by CMake using template to support Qt5 and Qt6.
# See rvui.mu.in
rvui.mu
# See window_mode.mu.in
window_mode.mu
# See session_manager.mu.in
session_manager.mu
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
url = https://github.com/shotgunsoftware/openrv-WFObj.git
[submodule "src/pub"]
path = src/pub
url = https://github.com/shotgunsoftware/openrv-pub.git
url = [email protected]:cedrik-fuoco-adsk/openrv-pub.git
branch = qt6
4 changes: 4 additions & 0 deletions cmake/defaults/cxx_defaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ ENDIF()
IF(RV_VFX_PLATFORM STREQUAL CY2024)
SET(RV_VFX_CY2024 ON)
ADD_COMPILE_DEFINITIONS(RV_VFX_CY2024)
SET(RV_QT_PACKAGE_NAME "Qt6")
SET(RV_QT_MU_TARGET "MuQt6")
ELSEIF(RV_VFX_PLATFORM STREQUAL CY2023)
SET(RV_VFX_CY2023 ON)
ADD_COMPILE_DEFINITIONS(RV_VFX_CY2023)
SET(RV_QT_PACKAGE_NAME "Qt5")
SET(RV_QT_MU_TARGET "MuQt5")
ENDIF()
1 change: 1 addition & 0 deletions cmake/defaults/rv_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ SET(RV_VFX_PLATFORM
"${_RV_VFX_PLATFORM}"
CACHE STRING "Set the VFX platform for installaing external dependencies" FORCE
)

SET_PROPERTY(
CACHE RV_VFX_PLATFORM
PROPERTY STRINGS ${_RV_VFX_PLATFORM}
Expand Down
27 changes: 24 additions & 3 deletions cmake/dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,15 @@ ENDIF()
IF(RV_TARGET_WINDOWS)
INCLUDE(expat)
ENDIF()
INCLUDE(qt5)

# TODO_QT: Not generic enough.. But maybe we could use something like NOT CY2023
# since after 2023, it is Qt6
IF(RV_VFX_PLATFORM STREQUAL CY2023)
INCLUDE(qt5)
ELSEIF(RV_VFX_PLATFORM STREQUAL CY2024)
INCLUDE(qt6)
ENDIF()

INCLUDE(openssl) # Python3 requirement
INCLUDE(python3)
INCLUDE(boost)
Expand Down Expand Up @@ -120,8 +128,21 @@ IF(RV_TARGET_WINDOWS)
ENDIF()
MESSAGE(STATUS "Using PNG: ${RV_DEPS_PNG_VERSION}")
MESSAGE(STATUS "Using Python3: ${RV_DEPS_PYTHON3_VERSION}")
MESSAGE(STATUS "Using PySide2: ${RV_DEPS_PYSIDE2_VERSION}")
MESSAGE(STATUS "Using Qt5: ${RV_DEPS_QT5_VERSION}")

RV_VFX_SET_VARIABLE(
_rv_deps_pyside_version
CY2023 "Using PySide2: ${RV_DEPS_PYSIDE_VERSION}"
CY2024 "Using PySide6: ${RV_DEPS_PYSIDE_VERSION}"
)
MESSAGE(STATUS "${_rv_deps_pyside_version}")

RV_VFX_SET_VARIABLE(
_rv_deps_qt_version
CY2023 "Using Qt5: ${RV_DEPS_QT5_VERSION}"
CY2024 "Using Qt6: ${RV_DEPS_QT6_VERSION}"
)
MESSAGE(STATUS "${_rv_deps_qt_version}")

MESSAGE(STATUS "Using Raw: ${RV_DEPS_RAW_VERSION}")
MESSAGE(STATUS "Using Tiff: ${RV_DEPS_TIFF_VERSION}")
MESSAGE(STATUS "Using WebP: ${RV_DEPS_WEBP_VERSION}")
Expand Down
2 changes: 0 additions & 2 deletions cmake/dependencies/oiio.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ ENDIF()

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

LIST(APPEND _configure_options "-DQt5_ROOT=${RV_DEPS_QT5_LOCATION}")

IF(NOT RV_TARGET_LINUX)
LIST(APPEND _configure_options "-DWebP_ROOT=${RV_DEPS_WEBP_ROOT_DIR}")
# Linux has a Link error related to relocation; WebP appears not built with -fPIC. Hence OIIO will build WebP itself.
Expand Down
167 changes: 114 additions & 53 deletions cmake/dependencies/python3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# SPDX-License-Identifier: Apache-2.0
#


SET(_python3_target
"RV_DEPS_PYTHON3"
)
Expand All @@ -12,8 +13,10 @@ SET(_opentimelineio_target
"RV_DEPS_OPENTIMELINEIO"
)

SET(_pyside2_target
"RV_DEPS_PYSIDE2"
RV_VFX_SET_VARIABLE(
_pyside_target
CY2023 "RV_DEPS_PYSIDE2"
CY2024 "RV_DEPS_PYSIDE6"
)

SET(PYTHON_VERSION_MAJOR
Expand Down Expand Up @@ -48,10 +51,9 @@ SET(_opentimelineio_version
)

RV_VFX_SET_VARIABLE(
_pyside2_version
_pyside_version
CY2023 "5.15.10"
# Need 5.15.11+ to support Python 3.11.
CY2024 "5.15.11"
CY2024 "6.5.3"
)

SET(_python3_download_url
Expand All @@ -70,13 +72,16 @@ SET(_opentimelineio_git_tag
"v${_opentimelineio_version}"
)

SET(_pyside2_archive_url
"https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside2/PySide2-${_pyside2_version}-src/pyside-setup-opensource-src-${_pyside2_version}.zip"
RV_VFX_SET_VARIABLE(
_pyside_archive_url
CY2023 "https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside2/PySide2-${_pyside_version}-src/pyside-setup-opensource-src-${_pyside_version}.zip"
CY2024 "https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside6/PySide6-${_pyside_version}-src/pyside-setup-everywhere-src-${_pyside_version}.zip"
)

RV_VFX_SET_VARIABLE(
_pyside2_download_hash
_pyside_download_hash
CY2023 "87841aaced763b6b52e9b549e31a493f"
CY2024 "8f652b08c1c74f9a80a2c0f16ff2a4ca"
CY2024 "515d3249c6e743219ff0d7dd25b8c8d8"
)

SET(_install_dir
Expand All @@ -103,13 +108,13 @@ IF(RV_TARGET_WINDOWS)
ENDIF()

FETCHCONTENT_DECLARE(
${_pyside2_target}
URL ${_pyside2_archive_url}
URL_HASH MD5=${_pyside2_download_hash}
${_pyside_target}
URL ${_pyside_archive_url}
URL_HASH MD5=${_pyside_download_hash}
SOURCE_SUBDIR "sources" # Avoids the top level CMakeLists.txt
)

FETCHCONTENT_MAKEAVAILABLE(${_pyside2_target})
FETCHCONTENT_MAKEAVAILABLE(${_pyside_target})

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

SET(_pyside2_make_command_script
"${PROJECT_SOURCE_DIR}/src/build/make_pyside.py"
)
SET(_pyside2_make_command
python3 "${_pyside2_make_command_script}"
)
LIST(APPEND _pyside2_make_command "--variant")
LIST(APPEND _pyside2_make_command ${CMAKE_BUILD_TYPE})
LIST(APPEND _pyside2_make_command "--source-dir")
LIST(APPEND _pyside2_make_command ${rv_deps_pyside2_SOURCE_DIR})
LIST(APPEND _pyside2_make_command "--output-dir")
LIST(APPEND _pyside2_make_command ${_install_dir})
LIST(APPEND _pyside2_make_command "--temp-dir")
LIST(APPEND _pyside2_make_command ${_build_dir})
IF(DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
LIST(APPEND _pyside2_make_command "--openssl-dir")
LIST(APPEND _pyside2_make_command ${RV_DEPS_OPENSSL_INSTALL_DIR})

# TODO_QT: Maybe we could use something like NOT CY2023
# since after 2023, it is Qt6
# TODO_QT: Below code could be simplified, but for now it is faster to test.
IF(RV_VFX_PLATFORM STREQUAL CY2023)
SET(_pyside_make_command_script
"${PROJECT_SOURCE_DIR}/src/build/make_pyside.py"
)
SET(_pyside_make_command
python3 "${_pyside_make_command_script}"
)

LIST(APPEND _pyside_make_command "--variant")
LIST(APPEND _pyside_make_command ${CMAKE_BUILD_TYPE})
LIST(APPEND _pyside_make_command "--source-dir")
LIST(APPEND _pyside_make_command ${rv_deps_pyside2_SOURCE_DIR})
LIST(APPEND _pyside_make_command "--output-dir")
LIST(APPEND _pyside_make_command ${_install_dir})
LIST(APPEND _pyside_make_command "--temp-dir")
LIST(APPEND _pyside_make_command ${_build_dir})

IF(DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
LIST(APPEND _pyside_make_command "--openssl-dir")
LIST(APPEND _pyside_make_command ${RV_DEPS_OPENSSL_INSTALL_DIR})
ENDIF()

LIST(APPEND _pyside_make_command "--python-dir")
LIST(APPEND _pyside_make_command ${_install_dir})
LIST(APPEND _pyside_make_command "--qt-dir")
LIST(APPEND _pyside_make_command ${RV_DEPS_QT5_LOCATION})
LIST(APPEND _pyside_make_command "--python-version")
LIST(APPEND _pyside_make_command "${RV_DEPS_PYTHON_VERSION_SHORT}")
ELSEIF(RV_VFX_PLATFORM STREQUAL CY2024)
SET(_pyside_make_command_script
"${PROJECT_SOURCE_DIR}/src/build/make_pyside6.py"
)
SET(_pyside_make_command
python3 "${_pyside_make_command_script}"
)

LIST(APPEND _pyside_make_command "--variant")
LIST(APPEND _pyside_make_command ${CMAKE_BUILD_TYPE})
LIST(APPEND _pyside_make_command "--source-dir")
LIST(APPEND _pyside_make_command ${rv_deps_pyside6_SOURCE_DIR})
LIST(APPEND _pyside_make_command "--output-dir")
LIST(APPEND _pyside_make_command ${_install_dir})
LIST(APPEND _pyside_make_command "--temp-dir")
LIST(APPEND _pyside_make_command ${_build_dir})

IF(DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
LIST(APPEND _pyside_make_command "--openssl-dir")
LIST(APPEND _pyside_make_command ${RV_DEPS_OPENSSL_INSTALL_DIR})
ENDIF()

LIST(APPEND _pyside_make_command "--python-dir")
LIST(APPEND _pyside_make_command ${_install_dir})
LIST(APPEND _pyside_make_command "--qt-dir")
LIST(APPEND _pyside_make_command ${RV_DEPS_QT6_LOCATION})
LIST(APPEND _pyside_make_command "--python-version")
LIST(APPEND _pyside_make_command "${RV_DEPS_PYTHON_VERSION_SHORT}")
ENDIF()
LIST(APPEND _pyside2_make_command "--python-dir")
LIST(APPEND _pyside2_make_command ${_install_dir})
LIST(APPEND _pyside2_make_command "--qt-dir")
LIST(APPEND _pyside2_make_command ${RV_DEPS_QT5_LOCATION})
LIST(APPEND _pyside2_make_command "--python-version")
LIST(APPEND _pyside2_make_command "${RV_DEPS_PYTHON_VERSION_SHORT}")

IF(RV_TARGET_WINDOWS)
IF(CMAKE_BUILD_TYPE MATCHES "^Debug$")
Expand Down Expand Up @@ -297,21 +339,40 @@ IF(RV_TARGET_WINDOWS
)
ENDIF()

SET(${_pyside2_target}-build-flag
${_install_dir}/${_pyside2_target}-build-flag
SET(${_pyside_target}-build-flag
${_install_dir}/${_pyside_target}-build-flag
)

ADD_CUSTOM_COMMAND(
COMMENT "Building PySide2 using ${_pyside2_make_command_script}"
OUTPUT ${${_pyside2_target}-build-flag}
# First PySide build script on Windows which doesn't respect '--debug' option
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/src/build/patch_PySide2/windows_desktop.py
${rv_deps_pyside2_SOURCE_DIR}/build_scripts/platforms/windows_desktop.py
COMMAND ${_pyside2_make_command} --prepare --build
COMMAND cmake -E touch ${${_pyside2_target}-build-flag}
DEPENDS ${_python3_target} ${_pyside2_make_command_script} ${${_python3_target}-requirements-flag}
USES_TERMINAL
)

# TODO_QT: Maybe we could use something like NOT CY2023
# since after 2023, it is Qt6
# TODO_QT: Below code could be simplified, but for now it is faster to test.
IF(RV_VFX_PLATFORM STREQUAL CY2023)
ADD_CUSTOM_COMMAND(
COMMENT "Building PySide2 using ${_pyside_make_command_script}"
OUTPUT ${${_pyside_target}-build-flag}
# First PySide build script on Windows which doesn't respect '--debug' option
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/src/build/patch_PySide2/windows_desktop.py
${rv_deps_pyside2_SOURCE_DIR}/build_scripts/platforms/windows_desktop.py
COMMAND ${_pyside_make_command} --prepare --build
COMMAND cmake -E touch ${${_pyside_target}-build-flag}
DEPENDS ${_python3_target} ${_pyside_make_command_script} ${${_python3_target}-requirements-flag}
USES_TERMINAL
)

SET(_build_flag_depends ${${_pyside_target}-build-flag})
ELSEIF(RV_VFX_PLATFORM STREQUAL CY2024)
ADD_CUSTOM_COMMAND(
COMMENT "Building PySide6 using ${_pyside_make_command_script}"
OUTPUT ${${_pyside_target}-build-flag}
COMMAND ${_pyside_make_command} --prepare --build
COMMAND cmake -E touch ${${_pyside_target}-build-flag}
DEPENDS ${_python3_target} ${_pyside_make_command_script} ${${_python3_target}-requirements-flag}
USES_TERMINAL
)

SET(_build_flag_depends ${${_pyside_target}-build-flag})
ENDIF()

IF(RV_TARGET_WINDOWS)
ADD_CUSTOM_COMMAND(
Expand All @@ -320,7 +381,7 @@ IF(RV_TARGET_WINDOWS)
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/lib ${RV_STAGE_LIB_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/include ${RV_STAGE_INCLUDE_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/bin ${RV_STAGE_BIN_DIR}
DEPENDS ${_python3_target} ${${_pyside2_target}-build-flag} ${${_python3_target}-requirements-flag}
DEPENDS ${_python3_target} ${${_python3_target}-requirements-flag} ${_build_flag_depends}
)
ADD_CUSTOM_TARGET(
${_python3_target}-stage-target ALL
Expand All @@ -333,7 +394,7 @@ ELSE()
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/lib ${RV_STAGE_LIB_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/include ${RV_STAGE_INCLUDE_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/bin ${RV_STAGE_BIN_DIR}
DEPENDS ${_python3_target} ${${_pyside2_target}-build-flag} ${${_python3_target}-requirements-flag}
DEPENDS ${_python3_target} ${${_python3_target}-requirements-flag} ${_build_flag_depends}
)
ADD_CUSTOM_TARGET(
${_python3_target}-stage-target ALL
Expand Down Expand Up @@ -370,8 +431,8 @@ SET(RV_DEPS_PYTHON3_VERSION
${_python3_version}
CACHE INTERNAL "" FORCE
)
SET(RV_DEPS_PYSIDE2_VERSION
${_pyside2_version}
SET(RV_DEPS_PYSIDE_VERSION
${_pyside_version}
CACHE INTERNAL "" FORCE
)

Expand Down
6 changes: 6 additions & 0 deletions cmake/dependencies/qt5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ FIND_PACKAGE(
REQUIRED
)

get_target_property(MOC_EXECUTABLE Qt5::moc IMPORTED_LOCATION)
get_target_property(UIC_EXECUTABLE Qt5::uic IMPORTED_LOCATION)

SET(QT_MOC_EXECUTABLE "${MOC_EXECUTABLE}" CACHE STRING "Qt MOC executable")
SET(QT_UIC_EXECUTABLE "${UIC_EXECUTABLE}" CACHE STRING "Qt UIC executable")

SET(_qt_copy_message
"Copying Qt into ${RV_STAGE_ROOT_DIR}"
)
Expand Down
Loading
Loading