Morten Johan Sørvig

Qt on macOS 10.14 Mojave

Published Thursday November 8th, 2018
10 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

10 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.

Leave a Reply

Your email address will not be published.

Get started today with Qt Download now