Skip to content

Commit b6c6ae7

Browse files
fix issue based on review comment
Signed-off-by: Cédrik Fuoco <[email protected]>
1 parent 41ce483 commit b6c6ae7

File tree

6 files changed

+39
-53
lines changed

6 files changed

+39
-53
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ _build*/*
2929
_install/*
3030
.venv/*
3131

32-
# These are no generated by CMake using template to support Qt5 and Qt6.
32+
# These are now generated by CMake using template to support Qt5 and Qt6.
3333
# See rvui.mu.in
3434
rvui.mu
3535
# See window_mode.mu.in

cmake/dependencies/qt6.cmake

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ IF(NOT RV_DEPS_QT6_LOCATION
1616
)
1717
MESSAGE(
1818
FATAL_ERROR
19-
"Unable to build without a RV_DEPS_QT6_LOCATION. It is required to provide a working Qt 5.15 root path to build. Example: cmake .. -DRV_DEPS_QT6_LOCATION=/Users/rv/Qt/5.15.11/clang_64"
19+
"Unable to build without a RV_DEPS_QT6_LOCATION. It is required to provide a working Qt 5.15 root path to build. Example: cmake .. -DRV_DEPS_QT6_LOCATION=/Users/rv/Qt/6.5.3/clang_64"
2020
)
2121
ENDIF()
2222

23-
#TODO : I think that the resources folder changed location
23+
# TODO : I think that the resources folder changed location
2424
SET(RV_DEPS_QT6_RESOURCES_FOLDER
2525
"${RV_DEPS_QT6_LOCATION}/resources"
2626
CACHE STRING "Path to the Qt resources files folder"
2727
)
2828

29-
#TODO : I think that the translations folder changed location
29+
# TODO : I think that the translations folder changed location
3030
SET(RV_DEPS_QT6_TRANSLATIONS_FOLDER
3131
"${RV_DEPS_QT6_LOCATION}/translations"
3232
CACHE STRING "Path to the Qt translations files folder"
@@ -49,19 +49,24 @@ FOREACH(
4949
ENDIF()
5050
ENDFOREACH()
5151

52-
# Testing if everything is alright.
53-
# In Qt6, QtWebEngine has been split into Qt6WebEngineCore and Qt6WebEngineWidgets.
52+
# Testing if everything is alright. In Qt6, QtWebEngine has been split into Qt6WebEngineCore and Qt6WebEngineWidgets.
5453
FIND_PACKAGE(
5554
Qt6
5655
COMPONENTS Core WebEngineCore WebEngineWidgets
5756
REQUIRED
5857
)
5958

60-
get_target_property(MOC_EXECUTABLE Qt6::moc IMPORTED_LOCATION)
61-
get_target_property(UIC_EXECUTABLE Qt6::uic IMPORTED_LOCATION)
59+
GET_TARGET_PROPERTY(MOC_EXECUTABLE Qt6::moc IMPORTED_LOCATION)
60+
GET_TARGET_PROPERTY(UIC_EXECUTABLE Qt6::uic IMPORTED_LOCATION)
6261

63-
SET(QT_MOC_EXECUTABLE "${MOC_EXECUTABLE}" CACHE STRING "Qt MOC executable")
64-
SET(QT_UIC_EXECUTABLE "${UIC_EXECUTABLE}" CACHE STRING "Qt UIC executable")
62+
SET(QT_MOC_EXECUTABLE
63+
"${MOC_EXECUTABLE}"
64+
CACHE STRING "Qt MOC executable"
65+
)
66+
SET(QT_UIC_EXECUTABLE
67+
"${UIC_EXECUTABLE}"
68+
CACHE STRING "Qt UIC executable"
69+
)
6570

6671
SET(_qt_copy_message
6772
"Copying Qt into ${RV_STAGE_ROOT_DIR}"
@@ -196,14 +201,13 @@ IF(RV_TARGET_WINDOWS)
196201
${SRC_DIR}/*.exe
197202
)
198203

199-
# Filtering. Some executables are needed for RV to work:
200-
# QtWebEngineProcess.exe
204+
# Filtering. Some executables are needed for RV to work: QtWebEngineProcess.exe
201205
FOREACH(
202-
_qt_executable
206+
_qt_executable
203207
${_qt_executables}
204208
)
205209
IF("${_qt_executable}" STREQUAL "QtWebEngineProcess.exe")
206-
LIST(REMOVE_ITEM _qt_executables "${_qt_executable}")
210+
LIST(REMOVE_ITEM _qt_executables "${_qt_executable}")
207211
ENDIF()
208212
ENDFOREACH()
209213

@@ -269,10 +273,14 @@ IF(RV_TARGET_WINDOWS)
269273
)
270274
ENDIF()
271275

272-
273-
# Qt5: OpenGLWidgets is in component Widgets
274-
# Qt6: OpenGLWidgets is in component OpenGLWidgets
275-
SET(QT6_QOPENGLWIDGET_COMPONENT "OpenGLWidgets" CACHE STRING "Qt QOpenGLWidget component name")
276-
SET(QT6_QOPENGLWIDGET_TARGET "Qt6::OpenGLWidgets" CACHE STRING "Qt QOpenGLWidget target name")
276+
# Qt5: OpenGLWidgets is in component Widgets Qt6: OpenGLWidgets is in component OpenGLWidgets
277+
SET(QT6_QOPENGLWIDGET_COMPONENT
278+
"OpenGLWidgets"
279+
CACHE STRING "Qt QOpenGLWidget component name"
280+
)
281+
SET(QT6_QOPENGLWIDGET_TARGET
282+
"Qt6::OpenGLWidgets"
283+
CACHE STRING "Qt QOpenGLWidget target name"
284+
)
277285

278286
MESSAGE(STATUS "${_qt_copy_message} -- DONE")

src/bin/python/py-interp/tests/test_PySide2.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
#
2-
# Copyright (C) 2023 Autodesk, Inc. All Rights Reserved.
3-
#
4-
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (C) 2023 Autodesk, Inc. All Rights Reserved.
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
55
#
66
import unittest
77

88
try:
9-
import PySide2
10-
from PySide2 import *
9+
from PySide2 import QtCore
1110
except ImportError:
12-
try:
13-
import PySide6
14-
from PySide6 import *
15-
except ImportError:
16-
pass
11+
try:
12+
from PySide6 import QtCore
13+
except ImportError:
14+
pass
1715

1816

1917
class TestPySide2(unittest.TestCase):

src/build/make_pyside6.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33

44
# *****************************************************************************
5-
# Copyright 2020 Autodesk, Inc. All rights reserved.
5+
# Copyright 2024 Autodesk, Inc. All rights reserved.
66
#
77
# SPDX-License-Identifier: Apache-2.0
88
#
@@ -216,25 +216,6 @@ def build() -> None:
216216
if OPENSSL_OUTPUT_DIR:
217217
pyside_build_args.append(f"--openssl={os.path.join(OPENSSL_OUTPUT_DIR, 'bin')}")
218218

219-
# PySide2 v5.15.2.1 builds with errors on Windows using Visual Studio 2019.
220-
# We force Visual Studio 2017 here to make it build without errors.
221-
# if platform.system() == "Windows":
222-
# # Add Qt jom to the path to build in parallel
223-
# jom_path = os.path.abspath(
224-
# os.path.join(QT_OUTPUT_DIR, "..", "..", "Tools", "QtCreator", "bin", "jom")
225-
# )
226-
# if os.path.exists(os.path.join(jom_path, "jom.exe")):
227-
# print(f"jom.exe was successfully located at: {jom_path}")
228-
# update_env_path([jom_path])
229-
# else:
230-
# print(f"Could not find jom.exe at the expected location: {jom_path}")
231-
# print(f"Build performance might be impacted")
232-
233-
# # Add the debug switch to match build type but only on Windows
234-
# # (on other platforms, PySide2 is built in release)
235-
# if VARIANT == "Debug":
236-
# pyside_build_args.append("--debug")
237-
238219
print(f"Executing {pyside_build_args}")
239220
subprocess.run(pyside_build_args).check_returncode()
240221

src/lib/app/RvCommon/QTGLVideoDevice.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ GLVideoDevice*
7070
QTGLVideoDevice::newSharedContextWorkerDevice() const
7171
{
7272
// NOTE_QT: QOpenGLWidget does not take a share parameter anymore. Try to share with setShareContext.
73-
QOpenGLWidget* w = new QOpenGLWidget(m_view->parentWidget());
74-
w->context()->setShareContext(m_view->context());
75-
return new QTGLVideoDevice(name() + "-workerContextDevice", w);
73+
QOpenGLWidget* openGLWidget = new QOpenGLWidget(m_view->parentWidget());
74+
openGLWidget->context()->setShareContext(m_view->context());
75+
return new QTGLVideoDevice(name() + "-workerContextDevice", openGLWidget);
7676
}
7777

7878
void

src/lib/app/RvCommon/RvApplication.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,6 @@ static void
471471
callRunCreateSession(void* a)
472472
{
473473
RvApplication* app = reinterpret_cast<RvApplication*>(a);
474-
std::cout << "??? Calling runCreateSession" << std::endl;
475474
app->runCreateSession();
476475
}
477476

0 commit comments

Comments
 (0)