ros-visualization / python_qt_binding

http://wiki.ros.org/python_qt_binding
BSD 3-Clause "New" or "Revised" License
34 stars 54 forks source link

Plan to support Qt6 #141

Open cybaol opened 4 months ago

cybaol commented 4 months ago

Since shiboken2 does not support python3.12 and upstream does not plan to support python3.12 in a no-maintenance state at this time, upstream's current development efforts are focused on shiboken6. Is there a plan to provide an option to support Qt6?

clalancette commented 4 months ago

Since shiboken2 does not support python3.12 and upstream does not plan to support python3.12 in a no-maintenance state at this time, upstream's current development efforts are focused on shiboken6. Is there a plan to provide an option to support Qt6?

Yeah, it's a good question.

In the long-term, we should switch to Qt6. In the short-term, we haven't spent any time trying to make it work. Note that the situation is complicated by Windows, where, due to various reasons, we cannot currently switch to Qt6.

I think the best way forward here is to first work on a solution that is compatible with both Qt5 and Qt6. That can land at any time. Then, once we fix Windows so we could possibly to update to Qt6 there, we can drop the Qt5 support.

We don't have immediate plans to do this, so if you are interested in contributing, it would be highly appreciated.

Sir-Photch commented 4 months ago

Would it be possible to build python_qt_binding against Qt6 on platforms that support Qt6 (so, FWIW, not Windows)?

clalancette commented 4 months ago

Would it be possible to build python_qt_binding against Qt6 on platforms that support Qt6 (so, FWIW, not Windows)?

Yep, that's what my reply above suggests.

srmainwaring commented 3 months ago

@clalancette I've made a start on adding Qt6 support using PySide6 and Shiboken6. At present it's just the changes needed to run using Qt6 only. The plan is to support both Qt5 and optionally Qt6 once the changes needed for Qt6 have been established.

The changes to date are here:

A few of the plugins are working, the container and docking seems to be ok. There are a number of changes needed to deal with deprecated or obsolete classes, which need to be traced down for the remaining plugins.

Figure: rqt - running on macOS Sonoma 14.4.1, Python 3.12, Qt 6.7

rqt-multi-qt6

Notes for macOS

Ensure brew is updated and upgraded

brew update && brew upgrade

Create a Python 3.12 virtual environment for the colcon build. Inherit the site packages to ensure consistency between the shiboken6 generator and the PySide6 environment (this is not guaranteed if PySide6 is installed using pip).

python3 -m venv --system-site-packages ~/.venv/ros2-3.12
. ~/.venv/ros2-3.12/bin/activate
pip install -U pip setuptools

The ported repos target ROS 2 Rolling, built using the wiki instructions. A few modifications are needed.

Update: 12 May

The windows for all the rqt plugins are now loading, some are still not displaying the topics correctly, or are missing events, but there are no major crashes.

To give some context, the target state I am aiming for is to be able to run ArduPilot SITL with DDS and Gazebo on ROS 2 Rolling with rviz and rqt for analysis, all on the latest version of macOS (M1 or Intel) in a Python 3.12 virtual environment using a fully upgraded brew environment (no pinned packages). I've established that this is feasible, the challenge now is to get all the various changes accepted into the appropriate repos (including this one).

ros2-rolling-ap-qt6