Removing the usage of Avkon to lock the screen orientation

Locking the screen orientation was not a Qt feature of the Symbian
port till Qt 4.7.2. Therefore, client applications had to do the
locking themselves. That locking is right now only achievable by
using Avkon Api. The template code of the Qt Quick App wizard did
exactly that.
Now, Qt 4.7.2 has the screen orientation lock built in. That
implementation was done for QTBUG-11785. No need to do that in the
application code, anymore.

This patch removes Avkon usage from the templates, using new enum keys
and setting QWidget flags, just like Maemo5 does.

Two Qt version checks/fixes:
1) If the application tries to lock the orientation on Qt < 4.7.2,
   a warning is given that this won't work
2) If Qt < 4.7.2 is used to build the application, the enum keys are
   not used directly but casted from constants

Task-Number: QTCREATORBUG-3598
Reviewed-by: ck
This commit is contained in:
Alessandro Portale
2011-02-02 13:41:22 +01:00
committed by con
parent fce232a165
commit d4e5890286
6 changed files with 56 additions and 72 deletions

View File

@@ -262,9 +262,6 @@ QByteArray AbstractMobileApp::generateProFile(QString *errorMessage) const
while (!(line = in.readLine()).isNull()) {
if (line.contains(QLatin1String("# TARGETUID3"))) {
valueOnNextLine = symbianTargetUid();
} else if (line.contains(QLatin1String("# ORIENTATIONLOCK"))
&& orientation() == ScreenOrientationAuto) {
uncommentNextLine = true;
} else if (line.contains(QLatin1String("# NETWORKACCESS"))
&& !networkEnabled()) {
uncommentNextLine = true;