Important: Please read the Qt Code of Conduct -

Q_DECL_OVERRIDE C++ 11 on Mac with QQuickWindow

  • Hi,

    I'm currently using the openglunderqml demo as a template for using my own C++ 11 GL library with QML. (Qt 5.5.1)

    I can compile the demo fine under linux with the addition of the CONFIG+=c++11 flags, however if I add the same flags to the mac build I get the following errors

    qquickwindow.h:174:38: error: only virtual member functions can be marked 'override'
    void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;

    qcompilerdetection.h:1014:26: note: expanded from macro 'Q_DECL_OVERRIDE'
    define Q_DECL_OVERRIDE override

    Anyone else had this problem and know how to solve it? ( I'm using clang++ -v
    Apple LLVM version 7.0.2 (clang-700.1.81)
    Target: x86_64-apple-darwin15.4.0)

    It compiles fine under mac without the C++ 11 flags so I'm presuming it's some form of issue with C++ 11 (and I understand the override mechanism and the functions should be virtual etc) so I'm guessing this is a bug?

    Any help would be appreciated.


  • Lifetime Qt Champion


    If I understand you correctly adding CONFIG += c++11 to the .pro file of the openglunderqml example makes the build fail on OS X ?

  • @SGaist Yes but not under Linux

  • Lifetime Qt Champion

    Just tested with an older version of Xcode and a more recent version of Qt but I haven't had that problem.

  • @SGaist Interesting, I'm on the latest OSX 10.11.4 Beta, I wonder if that is an issue. Will investigate more

Log in to reply