gz-gui icon indicating copy to clipboard operation
gz-gui copied to clipboard

Migrate Qt5 to Qt6

Open mjcarroll opened this issue 2 years ago • 6 comments

Tracking issue for tasks required to migrate from Qt5 to Qt6.

  • [ ] CMake Updates
  • [ ] Update MinimalScene for new APIs getting native access to VkImage and Metal equivalent.
  • [ ] QtGraphicalEffects is deprecated and has some incompatibilities: https://doc.qt.io/qt-6/qtgraphicaleffects5-index.html
  • [ ] QRegExp is deprecated: https://doc.qt.io/qt-6/qregexp.html

Environment: Ubuntu Noble + Gazebo Ionic + Qt6 + https://github.com/gazebosim/gz-gui/pull/596/ + https://github.com/gazebosim/gz-sim/pull/2305/ Initial test: gz sim minimal_scene.sdf

Goals

  1. Make Gz Ionic work with Qt5/Qt6
  2. Backport Qt5 changes to Harmonic

Tasks

  • [ ] Update our gz gui CI action to use Ubuntu Noble.
  • [ ] Forward port gz-qui8 to main.

Ideas

  • [ ] Load our qml codebase into Qt Creator / GammaRay to detect issues.

Current list of issues:

  • [ ] GzSpinBox. Replace it with a textbox widget.
  • [ ] TreeViewStyle not available in Qt6 qml .
  • [ ] Review if QtQuick.Controls 1.x is used and identify the replacement if any.
  • [x] [GUI] [Err] [Gui.cc:326] Failed to instantiate custom drawer, drawer will be empty.
  • [x] (fixed) Confirm if there's a segfault when running gz sim shapes.sdf or gz sim minimal_scene.sdf.
  • [ ] Propagate the changes made in gz-gui to compile plugins as modules.
  • [ ] 3D scene window not working. Minimal example to load a 3D scene: * https://doc.qt.io/qt-6/debug.html * There's a useful example in gz-rendering: examples/simple_demo_qml . * 1st test: Load MinimalScene only and create a <scene> element within <world> to change the background color. * 2nd test: Create an SDF with MinimalScene (gz-gui) and SceneManager (gz-sim).

mjcarroll avatar Oct 10 '23 15:10 mjcarroll

Compatible changes between qt5+qt6: https://github.com/gazebosim/gz-gui/pull/598

mjcarroll avatar Jan 29 '24 19:01 mjcarroll

Clazy checks: https://github.com/gazebosim/gz-gui/pull/584

mjcarroll avatar Jan 29 '24 19:01 mjcarroll

Bulk of the migrations for gui: https://github.com/gazebosim/gz-gui/pull/596

mjcarroll avatar Jan 29 '24 19:01 mjcarroll

Here's the list of qt6 packages I needed to install:

  • qml6-module-qt-labs-folderlistmodel
  • qml6-module-qt-labs-platform
  • qml6-module-qt-labs-settings
  • qml6-module-qtcharts
  • qml6-module-qtpositioning
  • qml6-module-qtqml-models
  • qml6-module-qtquick-controls
  • qml6-module-qtquick-dialogs
  • qml6-module-qtquick-layouts
  • qml6-module-qtquick-templates
  • qml6-module-qtquick-window
  • qml6-module-qtquick
  • qt6-base-dev
  • qt6-declarative-dev
  • libqt6quickcontrols2-6
  • qml6-module-qtcore
  • qml6-module-qtqml-workerscript
  • qml6-module-qt5compat-graphicaleffects
  • libqt6svg6

azeey avatar Jul 12 '24 16:07 azeey

I've added a fix in the gz-sim branch https://github.com/gazebosim/gz-sim/pull/2305/commits/a2652ac19b906587f441c40f29c886ceda7dd0d3 which should help with the communication between the server and GUI ECMs. With that, I see glimmers of hope :) Screen recording 2024-07-16 14.18.43.webm

azeey avatar Jul 16 '24 19:07 azeey

I was able to visualize the 3D screen even without your changes. It was hidden at the very left covered by other collapsed window plugins.

Screenshot from 2024-07-17 16-51-50

caguero avatar Jul 17 '24 14:07 caguero