From 554238d65b8257b7e45c778a9d7f5c2773091ca6 Mon Sep 17 00:00:00 2001 From: dt Date: Mon, 24 Jan 2011 15:33:27 +0100 Subject: [PATCH 1/7] Qt Quick App Wizard: Reset main file Reviewed-By: Alessandro Portale Task-Nr: QTCREATORBUG-3566 --- .../qt4projectmanager/wizards/qmlstandaloneappwizard.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizard.cpp b/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizard.cpp index 4b3b59b9b10..8581ca20e28 100644 --- a/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizard.cpp @@ -142,8 +142,7 @@ void QmlStandaloneAppWizard::prepareGenerateFiles(const QWizard *w, Q_UNUSED(errorMessage) const QmlStandaloneAppWizardDialog *wizard = qobject_cast(w); const QString mainQmlFile = wizard->m_qmlSourcesPage->mainQmlFile(); - if (!mainQmlFile.isEmpty()) - m_d->standaloneApp->setMainQmlFile(mainQmlFile); + m_d->standaloneApp->setMainQmlFile(mainQmlFile); } bool QmlStandaloneAppWizard::postGenerateFilesInternal(const Core::GeneratedFiles &l, From 0e8edf67729a2f90134381cdec5a398311e10e50 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Mon, 31 Jan 2011 15:05:20 +0100 Subject: [PATCH 2/7] Doc: building for Symbian on Linux and Mac OS Reviewed-by: Maurice Kalinowski --- doc/qtcreator.qdoc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index 3f5140e044c..0f2c008d0c2 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -3302,7 +3302,15 @@ For more information on the options you have, see \l{Specifying Build Settings}. - \section1 Troubleshooting Build Issues + \section1 Building for Symbian + + The tool chain for building applications locally on the development PC for + the \gui {Symbian Device} target is only supported on Windows. + If you develop on Linux or Mac OS, you must use the Remote Compiler + interface to a compilation service at Forum Nokia. For more information, + see \l{Building with Remote Compiler}. + + \section2 Troubleshooting Build Issues If you cannot build the application for a Symbian device, check that: From 6bf98fb7c305ab58204fe85c2a58b2c4a79066f6 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 27 Jan 2011 13:31:22 +0100 Subject: [PATCH 3/7] App wizard template: Network capabilty on by default Sets the Network capabilty on by default, in the wizard. Task-Number: QTCREATORBUG-3594 reviewed-by: con --- src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp b/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp index d19a5613f60..aa88ef1fb63 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp @@ -72,7 +72,8 @@ const QString AbstractMobileApp::FileStubVersion(QLatin1String("version")); const int AbstractMobileApp::StubVersion = 3; AbstractMobileApp::AbstractMobileApp() - : m_orientation(ScreenOrientationAuto), m_networkEnabled(false) + : m_orientation(ScreenOrientationAuto) + , m_networkEnabled(true) { } From 1da61869797f82f9cac6f452c2059a4ef8f5e6e5 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 1 Feb 2011 13:22:39 +0100 Subject: [PATCH 4/7] App wizard template: Move Network capability into main .pro Removes the "DEFINES += NETWORKACCESS" from the main .pro file replacing it by "symbian:TARGET.CAPABILITY += NetworkServices". Task-Number: QTCREATORBUG-3594 reviewed-by: con --- share/qtcreator/templates/mobileapp/app.pro | 8 ++++---- share/qtcreator/templates/qmlapp/app.pro | 8 ++++---- share/qtcreator/templates/shared/deployment.pri | 1 - 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/share/qtcreator/templates/mobileapp/app.pro b/share/qtcreator/templates/mobileapp/app.pro index d5b07cba275..ec826e61e60 100644 --- a/share/qtcreator/templates/mobileapp/app.pro +++ b/share/qtcreator/templates/mobileapp/app.pro @@ -8,13 +8,13 @@ DEPLOYMENTFOLDERS = # file1 dir1 # ORIENTATIONLOCK # DEFINES += ORIENTATIONLOCK -# Needs to be defined for Symbian -# NETWORKACCESS # -DEFINES += NETWORKACCESS - # TARGETUID3 # symbian:TARGET.UID3 = 0xE1111234 +# Allow network access on Symbian +# NETWORKACCESS # +symbian:TARGET.CAPABILITY += NetworkServices + # If your application uses the Qt Mobility libraries, uncomment # the following lines and add the respective components to the # MOBILITY variable. diff --git a/share/qtcreator/templates/qmlapp/app.pro b/share/qtcreator/templates/qmlapp/app.pro index 5dcaeb3f68b..cc8c3346451 100644 --- a/share/qtcreator/templates/qmlapp/app.pro +++ b/share/qtcreator/templates/qmlapp/app.pro @@ -13,13 +13,13 @@ QML_IMPORT_PATH = # ORIENTATIONLOCK # DEFINES += ORIENTATIONLOCK -# Needs to be defined for Symbian -# NETWORKACCESS # -DEFINES += NETWORKACCESS - # TARGETUID3 # symbian:TARGET.UID3 = 0xE1111234 +# Allow network access on Symbian +# NETWORKACCESS # +symbian:TARGET.CAPABILITY += NetworkServices + # Define QMLJSDEBUGGER to allow debugging of QML in debug builds # (This might significantly increase build time) # DEFINES += QMLJSDEBUGGER diff --git a/share/qtcreator/templates/shared/deployment.pri b/share/qtcreator/templates/shared/deployment.pri index bf421fb5faf..c225424f199 100644 --- a/share/qtcreator/templates/shared/deployment.pri +++ b/share/qtcreator/templates/shared/deployment.pri @@ -22,7 +22,6 @@ symbian { isEmpty(ICON):exists($${TARGET}.svg):ICON = $${TARGET}.svg isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone - contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices } else:win32 { copyCommand = for(deploymentfolder, DEPLOYMENTFOLDERS) { From 13e51e9683326f06cdaa5f1250eec3cb43338aeb Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 2 Feb 2011 09:06:10 +0100 Subject: [PATCH 5/7] L10n/German: Id->ID, Refactoring. Task-number: QTCREATORBUG-3668 --- share/qtcreator/translations/qtcreator_de.ts | 60 +++++++++++--------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 6b54749050c..7a6edc1779a 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -43,7 +43,7 @@ Attach to process ID: - Prozess-Id: + Prozess-ID: @@ -702,7 +702,7 @@ Could not find commits of id '%1' on %2. - Es konnten keine Abgaben des Datums %2 mit der Id '%1' gefunden werden. + Es konnten keine Abgaben des Datums %2 mit der ID '%1' gefunden werden. No cvs executable specified! @@ -771,7 +771,7 @@ Describe all files matching commit id - Alle zur Commit-Id gehörenden Dateien beschreiben: + Alle zur Commit-ID gehörenden Dateien beschreiben: Timeout: @@ -795,7 +795,7 @@ When checked, all files touched by a commit will be displayed when clicking on a revision number in the annotation view (retrieved via commit ID). Otherwise, only the respective file will be displayed. - Wenn die Option aktiviert ist, werden beim Klick auf die Revisionsnummer in der Annotationsansicht alle Dateien angezeigt, die zu einer Abgabe gehören (mittels Commit-Id bestimmt). Ansonsten wird nur die betreffende Datei angezeigt. + Wenn die Option aktiviert ist, werden beim Klick auf die Revisionsnummer in der Annotationsansicht alle Dateien angezeigt, die zu einer Abgabe gehören (mittels Commit-ID bestimmt). Ansonsten wird nur die betreffende Datei angezeigt. @@ -2008,6 +2008,10 @@ Sollen sie überschrieben werden? Yes, I know what I am doing. Ja, Ich bin mir dessen bewusst. + + &Refactor + &Refactoring + Unused variable Unbenutzte Variable @@ -2303,7 +2307,7 @@ Sollen sie überschrieben werden? Debugger::Internal::AttachExternalDialog Process ID - Prozess-Id + Prozess-ID Name @@ -3595,11 +3599,11 @@ Sie haben die Wahl zwischen Abwarten oder Abbrechen. Debugger::Internal::ThreadsHandler Thread&nbsp;id: - Thread-Id: + Thread-ID: Target&nbsp;id: - Ziel-Id: + Ziel-ID: Name: @@ -3647,7 +3651,7 @@ Sie haben die Wahl zwischen Abwarten oder Abbrechen. Thread ID - Thread-Id + Thread-ID @@ -3677,7 +3681,7 @@ Sie haben die Wahl zwischen Abwarten oder Abbrechen. Process started, PID: 0x%1, thread id: 0x%2, code segment: 0x%3, data segment: 0x%4. - Der Prozess wurde gestartet, PID: 0x%1, Thread-Id: 0x%2, Code-Segment: 0x%3, Datensegment: 0x%4. + Der Prozess wurde gestartet, PID: 0x%1, Thread-ID: 0x%2, Code-Segment: 0x%3, Datensegment: 0x%4. The reported code segment address (0x%1) might be invalid. Symbol resolution or setting breakoints may not work. @@ -9804,7 +9808,7 @@ Bitte prüfen Sie, ob das Gerät verbunden ist und die Anwendung 'TRK' Application running with pid %1. - Die Anwendung läuft mit der Prozess-Id: %1. + Die Anwendung läuft mit der Prozess-ID: %1. Finished. @@ -12770,7 +12774,7 @@ p, li { white-space: pre-wrap; } Qt4ProjectManager::Internal::S60Devices::Device Id: - Id: + ID: Name: @@ -14801,11 +14805,11 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.QmlDesigner::NavigatorTreeModel Invalid Id - Ungültige Id + Ungültige ID %1 is an invalid id - %1 ist keine gültige Id + %1 ist keine gültige ID Warning @@ -15094,7 +15098,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen. New id: - Neue Id: + Neue ID: Unused variable @@ -15102,11 +15106,11 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen. Refactoring - Refaktorisierung + Refactoring Rename id '%1'... - Id '%1' Umbenennen + ID '%1' umbenennen @@ -15596,15 +15600,15 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen. expected id - Id erwartet + ID erwartet using string literals for ids is discouraged - Von der Verwendung von Zeichenketten-Literalen als Ids wird abgeraten + Von der Verwendung von Zeichenketten-Literalen als IDs wird abgeraten ids must be lower case - Ids müssen mit einem Kleinbuchstaben beginnen + IDs müssen mit einem Kleinbuchstaben beginnen @@ -16866,7 +16870,7 @@ Haben Sie Qemu gestartet? Id - Id + ID @@ -17988,11 +17992,11 @@ Es wird versucht eine Paketdatei zu erstellen, es können aber Probleme auftrete QmlDesigner::PropertyEditor Invalid Id - Ungültige Id + Ungültige ID %1 is an invalid id - %1 ist keine gültige Id + %1 ist keine gültige ID @@ -18023,16 +18027,16 @@ Es wird versucht eine Paketdatei zu erstellen, es können aber Probleme auftrete Only alphanumeric characters and underscore allowed. Ids must begin with a lowercase letter. Es sind nur alphanumerische Zeichen und Unterstriche zulässig. -Ids müssen außerdem mit einem Kleinbuchstaben beginnen. +IDs müssen außerdem mit einem Kleinbuchstaben beginnen. Ids have to be unique. - Ids müssen eindeutig sein. + IDs müssen eindeutig sein. Invalid Id: %1 %2 - Ungültige Id: %1 + Ungültige ID: %1 %2 @@ -18047,7 +18051,7 @@ Ids müssen außerdem mit einem Kleinbuchstaben beginnen. QmlDesigner::QmlModelView Invalid Id - Ungültige Id + Ungültige ID @@ -19329,7 +19333,7 @@ Server: %2. Cannot attach to PID 0 - Der Debugger kann nicht an die Prozess-Id 0 angehängt werden + Der Debugger kann nicht an die Prozess-ID 0 angehängt werden Process %1 @@ -19450,7 +19454,7 @@ Das Setzen von Haltepunkten nach Dateinamen und Zeilennummern könnte nicht funk Debugger::Internal::TcfTrkGdbAdapter Process started, PID: 0x%1, thread id: 0x%2, code segment: 0x%3, data segment: 0x%4. - Der Prozess wurde gestartet, PID: 0x%1, Thread-Id: 0x%2, Code-Segment: 0x%3, Datensegment: 0x%4. + Der Prozess wurde gestartet, PID: 0x%1, Thread-ID: 0x%2, Code-Segment: 0x%3, Datensegment: 0x%4. The reported code segment address (0x%1) might be invalid. Symbol resolution or setting breakoints may not work. From fce232a1652362d7909c98c3a0ee0881fbcef91f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 2 Feb 2011 13:22:47 +0100 Subject: [PATCH 6/7] Debugger: Change gdb binary key, do not write binaries unless changed. Reviewed-by: con --- src/plugins/debugger/debuggeractions.cpp | 40 +++++++++++++++--------- src/plugins/debugger/debuggeractions.h | 2 ++ 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 25519bece22..9781efd86e5 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -55,7 +55,7 @@ using namespace Utils; static const char debugModeSettingsGroupC[] = "DebugMode"; -static const char gdbBinariesSettingsGroupC[] = "GdbBinaries"; +static const char gdbBinariesSettingsGroupC[] = "GdbBinaries21"; static const char debugModeGdbBinaryKeyC[] = "GdbBinary"; namespace Debugger { @@ -85,16 +85,14 @@ void DebuggerSettings::insertItem(int code, SavedAction *item) m_items[code] = item; } -void DebuggerSettings::readSettings(QSettings *settings) +// Convert gdb binaries from flat settings list (see writeSettings) +// into map ("binary1=gdb,1,2", "binary2=symbian_gdb,3,4"). +DebuggerSettings::GdbBinaryToolChainMap DebuggerSettings::gdbBinaryToolChainMapFromSettings(const QSettings *settings) { - foreach (SavedAction *item, m_items) - item->readSettings(settings); - // Convert gdb binaries from flat settings list (see writeSettings) - // into map ("binary1=gdb,1,2", "binary2=symbian_gdb,3,4"). - m_gdbBinaryToolChainMap.clear(); + GdbBinaryToolChainMap gdbBinaryToolChainMap; const QChar separator = QLatin1Char(','); const QString keyRoot = QLatin1String(gdbBinariesSettingsGroupC) + QLatin1Char('/') + - QLatin1String(debugModeGdbBinaryKeyC); + QLatin1String(debugModeGdbBinaryKeyC); for (int i = 1; ; i++) { const QString value = settings->value(keyRoot + QString::number(i)).toString(); if (value.isEmpty()) @@ -108,9 +106,9 @@ void DebuggerSettings::readSettings(QSettings *settings) foreach(const QString &t, tokens) { // Paranoia: Check if the there is already a binary configured for the toolchain. const int toolChain = t.toInt(); - const QString predefinedGdb = m_gdbBinaryToolChainMap.key(toolChain); + const QString predefinedGdb = gdbBinaryToolChainMap.key(toolChain); if (predefinedGdb.isEmpty()) { - m_gdbBinaryToolChainMap.insert(binary, toolChain); + gdbBinaryToolChainMap.insert(binary, toolChain); } else { const QString toolChainName = ProjectExplorer::ToolChain::toolChainName(static_cast(toolChain)); const QString msg = @@ -123,14 +121,24 @@ void DebuggerSettings::readSettings(QSettings *settings) } // Linux defaults #ifdef Q_OS_UNIX - if (m_gdbBinaryToolChainMap.isEmpty()) { + if (gdbBinaryToolChainMap.isEmpty()) { const QString gdb = QLatin1String("gdb"); - m_gdbBinaryToolChainMap.insert(gdb, ProjectExplorer::ToolChain::GCC); - m_gdbBinaryToolChainMap.insert(gdb, ProjectExplorer::ToolChain::LINUX_ICC); - m_gdbBinaryToolChainMap.insert(gdb, ProjectExplorer::ToolChain::OTHER); - m_gdbBinaryToolChainMap.insert(gdb, ProjectExplorer::ToolChain::UNKNOWN); + gdbBinaryToolChainMap.insert(gdb, ProjectExplorer::ToolChain::GCC); + gdbBinaryToolChainMap.insert(gdb, ProjectExplorer::ToolChain::LINUX_ICC); + gdbBinaryToolChainMap.insert(gdb, ProjectExplorer::ToolChain::OTHER); + gdbBinaryToolChainMap.insert(gdb, ProjectExplorer::ToolChain::UNKNOWN); } #endif + return gdbBinaryToolChainMap; +} + +void DebuggerSettings::readSettings(QSettings *settings) +{ + foreach (SavedAction *item, m_items) + item->readSettings(settings); + // Convert gdb binaries from flat settings list (see writeSettings) + // into map ("binary1=gdb,1,2", "binary2=symbian_gdb,3,4"). + m_gdbBinaryToolChainMap = gdbBinaryToolChainMapFromSettings(settings); } void DebuggerSettings::writeSettings(QSettings *settings) const @@ -139,6 +147,8 @@ void DebuggerSettings::writeSettings(QSettings *settings) const item->writeSettings(settings); // Convert gdb binaries map into a flat settings list of // ("binary1=gdb,1,2", "binary2=symbian_gdb,3,4"). It needs to be ASCII for installers + if (m_gdbBinaryToolChainMap == gdbBinaryToolChainMapFromSettings(settings)) + return; QString lastBinary; QStringList settingsList; const QChar separator = QLatin1Char(','); diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index 83d624ca81d..a97d705a249 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -76,6 +76,8 @@ public slots: void writeSettings(QSettings *settings) const; private: + static GdbBinaryToolChainMap gdbBinaryToolChainMapFromSettings(const QSettings *s); + QHash m_items; GdbBinaryToolChainMap m_gdbBinaryToolChainMap; }; From d4e5890286f56c1976a187e75eb48fdf64269e55 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 2 Feb 2011 13:41:22 +0100 Subject: [PATCH 7/7] 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 --- share/qtcreator/templates/mobileapp/app.pro | 4 -- .../templates/mobileapp/mainwindow.cpp | 58 +++++++++---------- share/qtcreator/templates/qmlapp/app.pro | 4 -- .../qmlapplicationviewer.cpp | 58 +++++++++---------- .../qtcreator/templates/shared/deployment.pri | 1 - .../wizards/abstractmobileapp.cpp | 3 - 6 files changed, 56 insertions(+), 72 deletions(-) diff --git a/share/qtcreator/templates/mobileapp/app.pro b/share/qtcreator/templates/mobileapp/app.pro index ec826e61e60..5c1eacc1144 100644 --- a/share/qtcreator/templates/mobileapp/app.pro +++ b/share/qtcreator/templates/mobileapp/app.pro @@ -4,10 +4,6 @@ # dir1.source = mydir DEPLOYMENTFOLDERS = # file1 dir1 -# Avoid auto screen rotation -# ORIENTATIONLOCK # -DEFINES += ORIENTATIONLOCK - # TARGETUID3 # symbian:TARGET.UID3 = 0xE1111234 diff --git a/share/qtcreator/templates/mobileapp/mainwindow.cpp b/share/qtcreator/templates/mobileapp/mainwindow.cpp index aad030d8aa1..e719b5f9169 100644 --- a/share/qtcreator/templates/mobileapp/mainwindow.cpp +++ b/share/qtcreator/templates/mobileapp/mainwindow.cpp @@ -11,13 +11,6 @@ #include -#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) -#include -#include -#include -#include -#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK - MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { @@ -31,40 +24,45 @@ MainWindow::~MainWindow() void MainWindow::setOrientation(ScreenOrientation orientation) { -#ifdef Q_OS_SYMBIAN +#if defined(Q_OS_SYMBIAN) + // If the version of Qt on the device is < 4.7.2, that attribute won't work if (orientation != ScreenOrientationAuto) { -#if defined(ORIENTATIONLOCK) - const CAknAppUiBase::TAppUiOrientation uiOrientation = - (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait - : CAknAppUi::EAppUiOrientationLandscape; - CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); - TRAPD(error, - if (appUi) - appUi->SetOrientationL(uiOrientation); - ); - Q_UNUSED(error) -#else // ORIENTATIONLOCK - qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation."); -#endif // ORIENTATIONLOCK + const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.')); + if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) { + qWarning("Screen orientation locking only supported with Qt 4.7.2 and above"); + return; + } } -#elif defined(Q_WS_MAEMO_5) +#endif // Q_OS_SYMBIAN + Qt::WidgetAttribute attribute; switch (orientation) { +#if QT_VERSION < 0x040702 + // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes case ScreenOrientationLockPortrait: - attribute = Qt::WA_Maemo5PortraitOrientation; + attribute = static_cast(128); break; case ScreenOrientationLockLandscape: - attribute = Qt::WA_Maemo5LandscapeOrientation; + attribute = static_cast(129); break; - case ScreenOrientationAuto: default: - attribute = Qt::WA_Maemo5AutoOrientation; + case ScreenOrientationAuto: + attribute = static_cast(130); break; - } +#else // QT_VERSION < 0x040702 + case ScreenOrientationLockPortrait: + attribute = Qt::WA_LockPortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_LockLandscapeOrientation; + break; + default: + case ScreenOrientationAuto: + attribute = Qt::WA_AutoOrientation; + break; +#endif // QT_VERSION < 0x040702 + }; setAttribute(attribute, true); -#else // Q_OS_SYMBIAN - Q_UNUSED(orientation); -#endif // Q_OS_SYMBIAN } void MainWindow::showExpanded() diff --git a/share/qtcreator/templates/qmlapp/app.pro b/share/qtcreator/templates/qmlapp/app.pro index cc8c3346451..1ba2bce8235 100644 --- a/share/qtcreator/templates/qmlapp/app.pro +++ b/share/qtcreator/templates/qmlapp/app.pro @@ -9,10 +9,6 @@ DEPLOYMENTFOLDERS = folder_01 # QML_IMPORT_PATH # QML_IMPORT_PATH = -# Avoid auto screen rotation -# ORIENTATIONLOCK # -DEFINES += ORIENTATIONLOCK - # TARGETUID3 # symbian:TARGET.UID3 = 0xE1111234 diff --git a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp index 59d9750edd6..4298aa74671 100644 --- a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp +++ b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -27,13 +27,6 @@ #include #endif -#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) -#include -#include -#include -#include -#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK - #if defined(QMLJSDEBUGGER) // Enable debugging before any QDeclarativeEngine is created @@ -108,40 +101,45 @@ void QmlApplicationViewer::addImportPath(const QString &path) void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) { -#ifdef Q_OS_SYMBIAN +#if defined(Q_OS_SYMBIAN) + // If the version of Qt on the device is < 4.7.2, that attribute won't work if (orientation != ScreenOrientationAuto) { -#if defined(ORIENTATIONLOCK) - const CAknAppUiBase::TAppUiOrientation uiOrientation = - (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait - : CAknAppUi::EAppUiOrientationLandscape; - CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); - TRAPD(error, - if (appUi) - appUi->SetOrientationL(uiOrientation); - ); - Q_UNUSED(error) -#else // ORIENTATIONLOCK - qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation."); -#endif // ORIENTATIONLOCK + const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.')); + if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) { + qWarning("Screen orientation locking only supported with Qt 4.7.2 and above"); + return; + } } -#elif defined(Q_WS_MAEMO_5) +#endif // Q_OS_SYMBIAN + Qt::WidgetAttribute attribute; switch (orientation) { +#if QT_VERSION < 0x040702 + // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes case ScreenOrientationLockPortrait: - attribute = Qt::WA_Maemo5PortraitOrientation; + attribute = static_cast(128); break; case ScreenOrientationLockLandscape: - attribute = Qt::WA_Maemo5LandscapeOrientation; + attribute = static_cast(129); break; - case ScreenOrientationAuto: default: - attribute = Qt::WA_Maemo5AutoOrientation; + case ScreenOrientationAuto: + attribute = static_cast(130); break; - } +#else // QT_VERSION < 0x040702 + case ScreenOrientationLockPortrait: + attribute = Qt::WA_LockPortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_LockLandscapeOrientation; + break; + default: + case ScreenOrientationAuto: + attribute = Qt::WA_AutoOrientation; + break; +#endif // QT_VERSION < 0x040702 + }; setAttribute(attribute, true); -#else // Q_OS_SYMBIAN - Q_UNUSED(orientation); -#endif // Q_OS_SYMBIAN } void QmlApplicationViewer::showExpanded() diff --git a/share/qtcreator/templates/shared/deployment.pri b/share/qtcreator/templates/shared/deployment.pri index c225424f199..10c36f748a4 100644 --- a/share/qtcreator/templates/shared/deployment.pri +++ b/share/qtcreator/templates/shared/deployment.pri @@ -21,7 +21,6 @@ MAINPROFILEPWD = $$PWD symbian { isEmpty(ICON):exists($${TARGET}.svg):ICON = $${TARGET}.svg isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 - contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone } else:win32 { copyCommand = for(deploymentfolder, DEPLOYMENTFOLDERS) { diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp b/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp index aa88ef1fb63..212c2555fb5 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp @@ -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;