Project:Qt/Qt6 migration notes

From Gentoo Wiki
Jump to:navigation Jump to:search

Packaging differences between Qt5 and Qt6

May notice that e.g. dev-qt/qtgui:6 and dev-qt/qtquickcontrols2:6 do not exist in the tree, functionalities are still there in Qt6 but provided by different packages.

Not exhaustive but, to help with migrating ebuilds, the rough mapping from Qt5 to Qt6 is:

From qtbase

  • dev-qt/qtconcurrent:5dev-qt/qtbase:6[concurrent]
  • dev-qt/qtcore:5dev-qt/qtbase:6
  • dev-qt/qtdbus:5dev-qt/qtbase:6[dbus]
  • dev-qt/qtgui:5dev-qt/qtbase:6[gui] (IUSE for jpeg and png were removed, support is always available)
  • dev-qt/qtnetwork:5dev-qt/qtbase:6[network]
  • dev-qt/qtopengl:5dev-qt/qtbase:6[opengl]
  • dev-qt/qtpaths:5dev-qt/qtbase:6
  • dev-qt/qtprintsupport:5dev-qt/qtbase:6[gui,widgets] (not with [cups])
  • dev-qt/qtsql:5dev-qt/qtbase:6[sql] (reminder that if a package requires a specific database type, need to specify it, e.g. [sqlite])
  • dev-qt/qttest:5dev-qt/qtbase:6 (not with [test])
  • dev-qt/qtwidgets:5dev-qt/qtbase:6[widgets]
  • dev-qt/qtxml:5dev-qt/qtbase:6[xml]

All qtbase modules IUSE are enabled by default except opengl which is enabled by desktop profiles.

From qttools

  • dev-qt/designer:5dev-qt/qttools:6[designer] or dev-qt/qttools:6[widgets] (latter is for if only need Qt6UiTools, please verify given some Qt5 ebuilds only depend on it for Qt5UiTools and do not actually need designer)
  • dev-qt/linguist-tools:5dev-qt/qttools:6[linguist] (on a side-note, GUI dev-qt/linguist:5 is obtained with [linguist,widgets] but there is no reason to depend on it)
  • dev-qt/qdbus:*dev-qt/qttools:6[qdbus]
  • dev-qt/qdoc:5dev-qt/qttools:6[qdoc]
  • dev-qt/qthelp:5dev-qt/qttools:6[assistant]

assistant, linguist, qdbus, and widgets IUSE are enabled by default. More could be considered for default if needed (except qdoc due to clang, and ideally also not those that need qtdeclarative).

Misc others

  • dev-qt/qtbluetooth:5dev-qt/qtconnectivity:6[bluetooth] (also provides QtNFC with [nfc], but is disabled by default)
  • dev-qt/qtquickcontrols2:5dev-qt/qtdeclarative:6 (note that many Qml* and Quick* dependencies are satisfied by this, if in doubt grep for it (e.g. qlist -e dev-qt/qtdeclarative:6 | grep QuickControls2)
  • dev-qt/qtwaylandscanner:5dev-qt/qtwayland:6 (uncertain if this will be split again, cross building Qt6 has not really been worked on nor tested yet)

Unavailable in Qt6

  • dev-qt/qtgamepad:5
  • dev-qt/qtquickcontrols:5 (not to be confused with dev-qt/qtquickcontrols2:5)
  • dev-qt/qtscript:5
  • dev-qt/qtx11extras:5 (note technically still usable through Qt6::GuiPrivate, so if a package does then it is necessary to depend on dev-qt/qtbase:6=[gui] with a binding := operator due to private symbols usage)
  • dev-qt/qtxmlpatterns:5

Save for qtgamepad which was just not ported, these were deprecated and are now gone. Any package migrated to Qt6 should not be needing these.

Still unpackaged

  • dev-qt/qtdatavis3d:5

There is also new modules in Qt6 that are also unpackaged for now. File a bug with the reason if needed. New packages are only added if requested, so do not wait for nothing without asking.

Extra notes and reminders while migrating

  • It is somewhat common to need dev-qt/qt5compat:6 as a new dependency. Obvious but do verify build system files as it may not be 1:1 mapping.
  • There is a few dependencies that packages do not always directly link with (nor even look for at build time), but are still needed at runtime -- so verify before dropping dependencies. Common examples are image format modules loaded on-demand (dev-qt/qtimageformats:6, dev-qt/qtsvg:6) otherwise resulting in blank images/icons, and qml/quick imports (e.g. from dev-qt/qtwebchannel:6[qml]).
  • For dev-qt/* dependencies, always specify the SLOT (:6) even if Qt6-only to future-proof.
  • Only use a binding operator (:6=) if package is using Qt private APIs to avoid unnecessary rebuilds. If unsure odds are do not need it as this is primarily only used by dev-qt/* itself, but otherwise look at the symbols, e.g.
user $nm -CD /usr/lib/python*/site-packages/PyQt6/ | grep Qt_6_PRIVATE_API
                 U QMetaEnumBuilder::setIsScoped(bool)@Qt_6_PRIVATE_API

That symbol is provided by, thus dev-python/PyQt6 should depend on dev-qt/qtbase:6=. Rebuilds may not always be necessary when using these, but it will be fragile without and there is a record of breaking even on minor Qt versions (e.g. Qt6.6.0→6.6.1 broke PyQt6 without a rebuild, but 6.5.3→6.6.0 did not, never know). Note these packages will typically be using *_p.h Qt private headers too, and may break more easily on Qt bumps (but emergency fixes are often simple, try to avoid upper bounds that would block the whole Qt stack).