Qt5: error: "WA_LockPortraitOrientation" is not a member of "Qt"

I am trying to compile a Qt4 / Symbian project in Qt5, while still maintaining Qt4 / Symbian support.

A function MainWindow::setOrientationwith an automatically generated function is currently creating problems.

It gives me the following compiler errors:

error: 'WA_LockPortraitOrientation' is not a member of 'Qt'
error: 'WA_LockLandscapeOrientation' is not a member of 'Qt'
error: 'WA_AutoOrientation' is not a member of 'Qt'
+4
source share
2 answers

Yes, they were removed in Qt 5, as you noted yourself.

The reason is that these are functions only for Symbian, and such things simply confuse Qt users if they work only on a specific platform, especially if this platform is not even supported by Qt 5 in its essence.

gerrit :

https://codereview.qt-project.org/#change,11280

#if QT_VERSION < 0x040702
    // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes

:

#if (QT_VERSION < QT_VERSION_CHECK(4, 7, 2)) || (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
    // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes
    // Qt 5 has removed them.

, Qt, :

#if (QT_VERSION < QT_VERSION_CHECK(4, 7, 2)) || (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
...
#endif

, . , Qt , QtSerialPort.

+5

, :

#if QT_VERSION < 0x040702
    // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes

:

#if (QT_VERSION < QT_VERSION_CHECK(4, 7, 2)) || (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
    // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes
    // Qt 5 has removed them.
+2

All Articles