Morten Johan Sørvig

Qt on macOS 10.14 Mojave

Published Thursday November 8th, 2018
15 Comments on Qt on macOS 10.14 Mojave
Posted in macOS, Qt

The newest version of macOS 10.14 has now been released and this time there are two major changes that affect Qt applications: Core Animation (CA) layer backing is enabled for all native views, and dark mode has been introduced. We’ve been testing on the betas since this summer, those who follow Qt development closely might have seen the commits.

The Qt release target for the fixes is the 5.12 branch, which has a couple of implications for Qt users:

  • We encourage upgrading to Qt 5.12 to get fixes for macOS 10.14
  • The maximum supported Xcode version for Qt 5.11 and lower is Xcode 9 (SDK 10.13)

The latter point may require further explanation. New features such as Dark Mode, or behavior changes such as CA layer backing are gated on the SDK version used to link the application. This provides a compatibility mode for existing binaries and for code bases that have not yet been updated.

This workaround of using an older Xcode and SDK version also applies when using Qt 5.12, if you encounter a bug related to dark mode or layer backing that we have not fixed in Qt.

For more information, se the Qt for macOS documentation.

Do you like this? Share it
Share on LinkedInGoogle+Share on FacebookTweet about this on Twitter

Posted in macOS, Qt

15 comments

Dyami Caliri says:

Thank you Morten.

Can you help clarify the CA Layering issue? Our application is QWidget-based, with QOpenGLWidgets. Would it be affected by the issue? I ask because we are currently building Qt 5.9 on Mojave with XCode 10.1, and I haven’t seen any issues.

The dark mode isn’t an issue because we already stylize pretty much all of the colors, so we aren’t relying on Qt to get the color changes correctly.

Morten Johan Sørvig Morten Johan Sørvig says:

Hi, looks like you made a duplicate comment so I’ll reply here (comments sometimes gets stuck in moderation)

The official answer: Qt 5.9 does not support the 10.14 SDK, and will not be updated to do so. Please use Xcode 9 / SDK 10.13.

In practice it looks like many of the widgets examples work. I tried examples/opengl/qopenglwidget in particular, and it has the problem where animations/updates run to fast, similar to QTBUG-70962.

Dyami Caliri says:

Can you shed some more light on the CA layer backing issue?

We have a QWidget and QOpenGLWidget-based application. I have been compiling on Mojave with XCode 10.1, and haven’t seen any issues. Would you expect the issue to effect our application?

Will Stokes says:

FYI I’m successfully using XCode 10 / macOS 10.14 with Qt 5.9 and disabling dark mode until I upgrade to Qt 5.12 like so:

https://developer.apple.com/documentation/appkit/nsappearancecustomization/choosing_a_specific_appearance_for_your_app

Aka I simply added NSRequiresAquaSystemAppearance / true to my Info.plist.

Tor Arne Vestbø says:

That (may) work for dark mode, but you’ll still get layer backing, which does not have a Info.plist opt-out, so you should be aware that you are then building/running an unsupported configuration.

Will Stokes says:

Can you tell me more about this layer backing issue? We don’t use QML or GL. Does this issue also affect QWidget? We haven’t noticed the issue but are not sure what it is to be honest.

Morten Johan Sørvig Morten Johan Sørvig says:

The specific issues include blank/black application windows (QTBUG-71206 QTBUG-71044) and animations running to fast (QTBUG-70962).

Matthew Smith says:

I’m finding that apps simply won’t compile on Mojave using Qt 5.11 even though they will compile using 5.9. I get errors saying that the definition of QAction is incomplete — the compiler does not recognise it as a subclass of QObject and so trying to connect signals from a QAction results in a compile error. I used the online installer (haven’t tried compiling Qt myself).

Morten Johan Sørvig Morten Johan Sørvig says:

Are you missing an “#include “? It could be implicitly included by some other header in Qt 5.9.

Morten Johan Sørvig Morten Johan Sørvig says:

Looks like the comment system took away my angle brackets there. That should be an QAction include.

Matthew Smith says:

Yes — just added the #include lines to two source files and the error went away. Thanks.

Alexander says:

I recently moved to a new macbook, with Mojave and XCode 10. I copied over my QT installation, and can still develop. No problem with waiting for 5.12 on that point.
But.. when starting QT Creator it indicates there are updates. When trying to install those updates, the online installer fails with a message that XCode is not installed. This message keeps popping up, there is no way to decently exit the installer. Stranger as well is that is shows about all versions of XCode (I have seen 5, 6 and 8 being mentioned).
The same happens when I download the online installer and try a clean install.
Is a new version of the installer part of 5.12?

Morten Johan Sørvig Morten Johan Sørvig says:

Unfortunately I don’t know much about the inner workings of the installer. Your best option may be to file a bug on bugreports.qt.io (QTBUG, Component: Packaging & Installer).

Ray Donnelly says:

So 10.13 will become the new minimum? Urgh. Is there any chance the Qt company could stop with all this shiny macOS stuff? The minimum macOS for Qt sould, IMHO be 10.12 (as per Apple’s own support policy of supporting the 3 latest releases). You should not be forcing people to update their OSes like this.

Given Qt is an Application Framework, I would appreciate it if you would seriously consider things from a “needs to still run on old OSes” perspective.

Then again, decisions like using Blink for QtWebEngine removes Qt’s ability to make these decisions for itself.

Morten Johan Sørvig Morten Johan Sørvig says:

Hi, I agree that supporting a reasonable number of macOS versions is important for Qt as a framework.

And the good news is that the number of supported releases is in fact 3 (10.12, 10.13, 10.14). See the table at http://doc-snapshots.qt.io/qt5-5.12/macos.html . In other words, then SDK and runtime support version ranges are set individually.

Upstream Blink or Webkit may be more restrictive, but those restrictions apply to the users for those modules only.

Commenting closed.

Get started today with Qt Download now