Qt Extras Modules in Qt 6

Qt 6 is a result of the conscious effort to make the framework more efficient and easy to use.

We try to maintain binary and source compatibility for all the public APIs in each release, but some changes were inevitable in an effort to make Qt a better framework. One of those changes was to remove the platform-specific Extras modules, to ensure a cohesive cross-platform story and future for Qt 6.


Most of the the functionality offered by these modules have been replaced by a similar functionality in other Qt modules, for example through the new platform APIs.

The remaining APIs typically fell in one of three categories:

  • The functionality was deprecated in the relevant platform.
  • The API  had no known internal or external clients.
  • The API was overlapping with similar APIs on other platforms, warranting a cross-platform API.

For the latter two cases we will continue to survey the need for replacement APIs for future releases. Please see the linked bug reports below for details, or let us know if you have use-cases that are no longer covered.

Note: Snippets of code from the 5.15 branch of each module can often be incorporated directly into your application, as a stopgap solution.

The following is a quick run-down of the various changes to the modules.

Changes to Qt Mac Extras

QtMac namespace

Most members of the QtMac namespace have explicit replacements. The QtMac::fromCGImageRef function has been removed due to lack of known clients of the API.

QMacPasteboardMime

The QMacPasteboardMime class has been removed due to warranting a cross-platform solution. See QTBUG-93632 for details.

QMacToolBar

The QMacToolBar and QMacToolBarItem classes have been removed. Use QToolBar as a replacement.

There are also third party solution such as the MacHelper library.

Changes to Qt Windows Extras

QtWin namespace

Many members of the QtWin namespace have explicit replacements. To use these replacements with Qt Widgets or Qt Quick, operate on the QWindow representation of the relevant widget or control.

The remaining functions have been removed:

errorStringFromHresult

Only used internally in WinExtras. No other known clients of the API.

colorizationColor/isCompositionOpaque

Concept exists on other platforms (tint/accent color). Warrants new cross-platform API, for example a new QPalette role or platform theme property.

setWindowFlip3DPolicy

Windows 7 feature. No longer supported in Windows 10.

extendFrameIntoClientArea

Similar functionality exists on other platforms. Warrants cross-platform QWindow API to control the relationship between the client area and the non-client area (frame/titlebar). See QTBUG-94010 for details.

enableBlurBehind

Deprecated as of Windows 8.

taskbarActivateTab and taskbar(Add/Delete)Tab

No known clients of the API.

QWinMime

The QWinMime class has been removed due to warranting a cross-platform solution. See QTBUG-93632 for details.

Clients that still rely on the functionality can include the private header <QtGui/private/qtguiapplication_p.h> and <QtGui/private/qwindowsmime_p.h> and use the QWindowsApplication native interface to register new MIME types.

To enable private headers use QT += gui-private with qmake, or add a project dependency to Qt::GuiPrivate with CMake.

QWinJumpList

The QWinJumpList, QWinJumpListCategory, and QWinJumpListItem classes have been removed due to warranting a cross-platform solution. See QTBUG-94007 for details.

QWinTaskbarButton

The QWinTaskbarButton and QWinTaskbarProgress classes have been removed due to warranting a cross-platform solution. See QTBUG-94009 and QTBUG-94008 for details.

QWinThumbnailToolBar

The QWinThumbnailToolBar and QWinThumbnailToolBarButton classes have been removed due to lack of known clients of the API.

Changes to Qt X11 Extras

The QX11Info class has been removed.

The QX11Info::connection() and QX11Info::display() methods have been replaced by a QX11Application native interface for QGuiApplication.

Clients that still rely on the functionality can include the private header <QtGui/private/qtx11extras_p.h> as a stopgap solution.

To enable private headers use QT += core-private with qmake, or add a project dependency to Qt::CorePrivate with CMake.

Changes to Qt Android Extras

Key functionality from the module has been brought over to other Qt modules.

Clients that still rely on missing functionality can include the private header <QtCore/private/qandroidextras_p.h> as a stopgap solution.

To enable private headers use QT += core-private with qmake, or add a project dependency to Qt::CorePrivate with CMake.

QAndroidJniObject and QAndroidJniEnvironment

The QAndroidJniObject and QAndroidJniEnvironment classes have been replaced by QJniObject and QJniEnvironment respectively.

The QAndroidJniExceptionCleaner class has been replaced by QJniEnvironment::checkAndClearExceptions().

QtAndroid namespace

Many members of the QtAndroid namespace have replacements in the QAndroidApplication native interface.

The permission request APIs have been replaced by the cross-platform QCoreApplication::requestPermission() API.


Blog Topics:

Comments

Commenting for this post has ended.

Алексей Киреев
2 points
46 months ago

The QWinTaskbarButton and QWinTaskbarProgress classes have been removed due to warranting a cross-platform solution

Did I understand correctly that instead of offering a cross-platform solution now, the classes were simply removed?

Tor Arne Vestbø
-2 points
46 months ago

Correct. A cross platform solution for this will be considered for a future release. Note that in case of QWinTaskbarButton and friends you can pull the relevant code from the 5.15 branch into your project, if you still rely on the functionality. Please comment on the associated task if so, describing your use case. Thanks!

Rich ard
1 point
46 months ago

That is quite sad. It has raised another barrier meaning that it is not feasible to start porting any of my projects to Qt6, as my Windows users rely on these taskbar indications, especially Progress.

I look forward to a cross-platform solution that also supports macOS. Perhaps Qt6 will become useful next year.

Alex G
1 point
45 months ago

Yes, i plan to use Qt6 not before 2023 tbh...

Tor Arne Vestbø
0 points
46 months ago

Thanks for your feedback, and sorry this is preventing you from porting to Qt 6. If you can describe your application and how you use the existing APIs in QTBUG-94009 and QTBUG-94008 that would be great, thanks!

Rich ard
1 point
45 months ago

It's one of several Qt 5 APIs that are still missing from Qt 6.I do find it quite disappointing that these were removed entirely before their replacements were ready.It would be good to see a blog post listing which future versions of Qt 6 are now planned to add each currently-unavailable feature of Qt 5, so we can start to plan when a migration is likely to become feasible.

And of course, any existing Qt features that are not currently intended to be added to Qt 6 can receive some public comment.

S
Serhiy Malokhatko
0 points
45 months ago

Quite strange decision to remove QWinTaskbarProgress, it was in WinExtras so it was not supposed to be crossplatform

argama147
0 points
45 months ago

The QAndroidJniObject and QAndroidJniEnvironment classes have been replaced

Will JNI be available on platforms other than Android in the near future?

davehussey
0 points
17 months ago

Hmm I was using QtQuick.Extras (specifically the Gauge control which I was subclassing) . After porting a mere 198 applications from 5 to 6 I suddenly found that the Extras module had unexpectedly been removed and as a result hit a brick wall with this one. This is unplanned and unfortunate since I'll likely have to either figure out how to port the relevant parts of Extras to get the Gauge control and related things like RangeModel OR completely re-implement from scratch before I can move closer to actual release!