Changing template/qmljsdbg-lib as suggested in QTCREATORBUG-2885

- Renaming the screen orientation enum and keys
- Explicit constructors
- Virtual destructors
- Renamed some occurences of 'Qml' in comments to 'QML'
- Adding descriptive comments to all generated files which should
  not be touched by the user.
- Adding missing license headers to the qmljsdebugger sources

Task-Number: QTCREATORBUG-2885
Reviewed-by: Friedemann Kleint
Reviewed-by: dt
This commit is contained in:
Alessandro Portale
2010-11-01 17:03:46 +01:00
parent bc09afb5cf
commit 7d622f1145
31 changed files with 517 additions and 57 deletions

View File

@@ -1,3 +1,32 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "boundingrecthighlighter.h" #include "boundingrecthighlighter.h"
#include "qdeclarativeviewobserver.h" #include "qdeclarativeviewobserver.h"
#include "qmlobserverconstants.h" #include "qmlobserverconstants.h"

View File

@@ -1,3 +1,32 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef BOUNDINGRECTHIGHLIGHTER_H #ifndef BOUNDINGRECTHIGHLIGHTER_H
#define BOUNDINGRECTHIGHLIGHTER_H #define BOUNDINGRECTHIGHLIGHTER_H

View File

@@ -1,3 +1,32 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "colorpickertool.h" #include "colorpickertool.h"
#include "qdeclarativeviewobserver.h" #include "qdeclarativeviewobserver.h"

View File

@@ -1,3 +1,32 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef COLORPICKERTOOL_H #ifndef COLORPICKERTOOL_H
#define COLORPICKERTOOL_H #define COLORPICKERTOOL_H

View File

@@ -1,3 +1,6 @@
# This file is part of Qt Creator
# It enables debugging of Qt Quick applications
INCLUDEPATH += $$PWD INCLUDEPATH += $$PWD
HEADERS += \ HEADERS += \

View File

@@ -1,3 +1,32 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include <QLabel> #include <QLabel>
#include <QIcon> #include <QIcon>
#include <QAction> #include <QAction>

View File

@@ -1,3 +1,32 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef QMLTOOLBAR_H #ifndef QMLTOOLBAR_H
#define QMLTOOLBAR_H #define QMLTOOLBAR_H

View File

@@ -1,3 +1,32 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "subcomponenteditortool.h" #include "subcomponenteditortool.h"
#include "../qdeclarativeviewobserver_p.h" #include "../qdeclarativeviewobserver_p.h"
#include "subcomponentmasklayeritem.h" #include "subcomponentmasklayeritem.h"

View File

@@ -1,3 +1,32 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef SUBCOMPONENTEDITORTOOL_H #ifndef SUBCOMPONENTEDITORTOOL_H
#define SUBCOMPONENTEDITORTOOL_H #define SUBCOMPONENTEDITORTOOL_H

View File

@@ -1,3 +1,32 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "subcomponentmasklayeritem.h" #include "subcomponentmasklayeritem.h"
#include "qmlobserverconstants.h" #include "qmlobserverconstants.h"
#include "qdeclarativeviewobserver.h" #include "qdeclarativeviewobserver.h"

View File

@@ -1,3 +1,32 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef SUBCOMPONENTMASKLAYERITEM_H #ifndef SUBCOMPONENTMASKLAYERITEM_H
#define SUBCOMPONENTMASKLAYERITEM_H #define SUBCOMPONENTMASKLAYERITEM_H

View File

@@ -1,3 +1,32 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "toolbarcolorbox.h" #include "toolbarcolorbox.h"
#include "qmlobserverconstants.h" #include "qmlobserverconstants.h"

View File

@@ -1,3 +1,32 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef ToolBarColorBox_H #ifndef ToolBarColorBox_H
#define ToolBarColorBox_H #define ToolBarColorBox_H

View File

@@ -1,3 +1,32 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "zoomtool.h" #include "zoomtool.h"
#include "../qdeclarativeviewobserver_p.h" #include "../qdeclarativeviewobserver_p.h"

View File

@@ -1,3 +1,32 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef ZOOMTOOL_H #ifndef ZOOMTOOL_H
#define ZOOMTOOL_H #define ZOOMTOOL_H

View File

@@ -1,3 +1,6 @@
# This file is part of Qt Creator
# It enables debugging of Qt Quick applications
QT += declarative script QT += declarative script
INCLUDEPATH += $$PWD/include INCLUDEPATH += $$PWD/include
DEPENDPATH += $$PWD $$PWD/include editor $$PWD/qt-private DEPENDPATH += $$PWD $$PWD/include editor $$PWD/qt-private

View File

@@ -1,3 +1,6 @@
# This file is part of Qt Creator
# It enables debugging of Qt Quick applications
INCLUDEPATH += $$PWD/include INCLUDEPATH += $$PWD/include
DEPENDPATH += $PPWD/include DEPENDPATH += $PPWD/include
QT += declarative script QT += declarative script

View File

@@ -1,3 +1,6 @@
# This file is part of Qt Creator
# It enables debugging of Qt Quick applications
TEMPLATE = lib TEMPLATE = lib
CONFIG+=dll CONFIG+=dll
TARGET = QmlJSDebugger TARGET = QmlJSDebugger

View File

@@ -7,7 +7,7 @@ int main(int argc, char *argv[])
QApplication app(argc, argv); QApplication app(argc, argv);
MainWindow mainWindow; MainWindow mainWindow;
mainWindow.setOrientation(MainWindow::Auto); // ORIENTATION mainWindow.setOrientation(MainWindow::ScreenOrientationAuto); // ORIENTATION
#ifdef Q_OS_SYMBIAN #ifdef Q_OS_SYMBIAN
mainWindow.showFullScreen(); mainWindow.showFullScreen();

View File

@@ -1,3 +1,11 @@
/*
This file was generated by the Mobile Qt Application wizard of Qt Creator.
MainWindow is a convenience class containing mobile device specific code
such as screen orientation handling.
It is recommended not to modify this file, since newer versions of Qt Creator
may offer an updated version of it.
*/
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
@@ -21,13 +29,13 @@ MainWindow::~MainWindow()
delete ui; delete ui;
} }
void MainWindow::setOrientation(Orientation orientation) void MainWindow::setOrientation(ScreenOrientation orientation)
{ {
#ifdef Q_OS_SYMBIAN #ifdef Q_OS_SYMBIAN
if (orientation != Auto) { if (orientation != ScreenOrientationAuto) {
#if defined(ORIENTATIONLOCK) #if defined(ORIENTATIONLOCK)
const CAknAppUiBase::TAppUiOrientation uiOrientation = const CAknAppUiBase::TAppUiOrientation uiOrientation =
(orientation == LockPortrait) ? CAknAppUi::EAppUiOrientationPortrait (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
: CAknAppUi::EAppUiOrientationLandscape; : CAknAppUi::EAppUiOrientationLandscape;
CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi()); CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
TRAPD(error, TRAPD(error,
@@ -41,13 +49,13 @@ void MainWindow::setOrientation(Orientation orientation)
#elif defined(Q_WS_MAEMO_5) #elif defined(Q_WS_MAEMO_5)
Qt::WidgetAttribute attribute; Qt::WidgetAttribute attribute;
switch (orientation) { switch (orientation) {
case LockPortrait: case ScreenOrientationLockPortrait:
attribute = Qt::WA_Maemo5PortraitOrientation; attribute = Qt::WA_Maemo5PortraitOrientation;
break; break;
case LockLandscape: case ScreenOrientationLockLandscape:
attribute = Qt::WA_Maemo5LandscapeOrientation; attribute = Qt::WA_Maemo5LandscapeOrientation;
break; break;
case Auto: case ScreenOrientationAuto:
default: default:
attribute = Qt::WA_Maemo5AutoOrientation; attribute = Qt::WA_Maemo5AutoOrientation;
break; break;

View File

@@ -1,3 +1,11 @@
/*
This file was generated by the Mobile Qt Application wizard of Qt Creator.
MainWindow is a convenience class containing mobile device specific code
such as screen orientation handling.
It is recommended not to modify this file, since newer versions of Qt Creator
may offer an updated version of it.
*/
#ifndef MAINWINDOW_H #ifndef MAINWINDOW_H
#define MAINWINDOW_H #define MAINWINDOW_H
@@ -11,16 +19,16 @@ class MainWindow : public QMainWindow
{ {
Q_OBJECT Q_OBJECT
public: public:
enum Orientation { enum ScreenOrientation {
LockPortrait, ScreenOrientationLockPortrait,
LockLandscape, ScreenOrientationLockLandscape,
Auto ScreenOrientationAuto
}; };
MainWindow(QWidget *parent = 0); explicit MainWindow(QWidget *parent = 0);
~MainWindow(); virtual ~MainWindow();
void setOrientation(Orientation orientation); void setOrientation(ScreenOrientation orientation);
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;

View File

@@ -5,7 +5,7 @@ folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01 DEPLOYMENTFOLDERS = folder_01
# DEPLOYMENTFOLDERS_END # # DEPLOYMENTFOLDERS_END #
# Additional import path used to resolve Qml modules in Creator's code model # Additional import path used to resolve QML modules in Creator's code model
# QML_IMPORT_PATH # # QML_IMPORT_PATH #
QML_IMPORT_PATH = QML_IMPORT_PATH =

View File

@@ -7,7 +7,7 @@ int main(int argc, char *argv[])
QmlApplicationViewer viewer; QmlApplicationViewer viewer;
viewer.addImportPath(QLatin1String("modules")); // ADDIMPORTPATH viewer.addImportPath(QLatin1String("modules")); // ADDIMPORTPATH
viewer.setOrientation(QmlApplicationViewer::Auto); // ORIENTATION viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); // ORIENTATION
viewer.setMainQmlFile(QLatin1String("qml/app/main.qml")); // MAINQML viewer.setMainQmlFile(QLatin1String("qml/app/main.qml")); // MAINQML
viewer.show(); viewer.show();

View File

@@ -1,3 +1,12 @@
/*
This file was generated by the Qt Quick Application wizard of Qt Creator.
QmlApplicationViewer is a convenience class containing mobile device specific
code such as screen orientation handling. Also QML paths and debugging are
handled here.
It is recommended not to modify this file, since newer versions of Qt Creator
may offer an updated version of it.
*/
#include "qmlapplicationviewer.h" #include "qmlapplicationviewer.h"
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
@@ -77,13 +86,13 @@ void QmlApplicationViewer::addImportPath(const QString &path)
engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path)); engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
} }
void QmlApplicationViewer::setOrientation(Orientation orientation) void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
{ {
#ifdef Q_OS_SYMBIAN #ifdef Q_OS_SYMBIAN
if (orientation != Auto) { if (orientation != ScreenOrientationAuto) {
#if defined(ORIENTATIONLOCK) #if defined(ORIENTATIONLOCK)
const CAknAppUiBase::TAppUiOrientation uiOrientation = const CAknAppUiBase::TAppUiOrientation uiOrientation =
(orientation == LockPortrait) ? CAknAppUi::EAppUiOrientationPortrait (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
: CAknAppUi::EAppUiOrientationLandscape; : CAknAppUi::EAppUiOrientationLandscape;
CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi()); CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
TRAPD(error, TRAPD(error,
@@ -97,13 +106,13 @@ void QmlApplicationViewer::setOrientation(Orientation orientation)
#elif defined(Q_WS_MAEMO_5) #elif defined(Q_WS_MAEMO_5)
Qt::WidgetAttribute attribute; Qt::WidgetAttribute attribute;
switch (orientation) { switch (orientation) {
case LockPortrait: case ScreenOrientationLockPortrait:
attribute = Qt::WA_Maemo5PortraitOrientation; attribute = Qt::WA_Maemo5PortraitOrientation;
break; break;
case LockLandscape: case ScreenOrientationLockLandscape:
attribute = Qt::WA_Maemo5LandscapeOrientation; attribute = Qt::WA_Maemo5LandscapeOrientation;
break; break;
case Auto: case ScreenOrientationAuto:
default: default:
attribute = Qt::WA_Maemo5AutoOrientation; attribute = Qt::WA_Maemo5AutoOrientation;
break; break;

View File

@@ -1,3 +1,12 @@
/*
This file was generated by the Qt Quick Application wizard of Qt Creator.
QmlApplicationViewer is a convenience class containing mobile device specific
code such as screen orientation handling. Also QML paths and debugging are
handled here.
It is recommended not to modify this file, since newer versions of Qt Creator
may offer an updated version of it.
*/
#ifndef QMLAPPLICATIONVIEWER_H #ifndef QMLAPPLICATIONVIEWER_H
#define QMLAPPLICATIONVIEWER_H #define QMLAPPLICATIONVIEWER_H
@@ -5,19 +14,21 @@
class QmlApplicationViewer : public QDeclarativeView class QmlApplicationViewer : public QDeclarativeView
{ {
Q_OBJECT
public: public:
enum Orientation { enum ScreenOrientation {
LockPortrait, ScreenOrientationLockPortrait,
LockLandscape, ScreenOrientationLockLandscape,
Auto ScreenOrientationAuto
}; };
QmlApplicationViewer(QWidget *parent = 0); explicit QmlApplicationViewer(QWidget *parent = 0);
virtual ~QmlApplicationViewer(); virtual ~QmlApplicationViewer();
void setMainQmlFile(const QString &file); void setMainQmlFile(const QString &file);
void addImportPath(const QString &path); void addImportPath(const QString &path);
void setOrientation(Orientation orientation); void setOrientation(ScreenOrientation orientation);
void show(); void show();
private: private:

View File

@@ -1,5 +1,8 @@
# This file should not be edited. # This file was generated by the Qt Quick Application wizard of Qt Creator.
# Future versions of Qt Creator might offer updated versions of this file. # The code below adds the QmlApplicationViewer to the project and handles the
# activation of QML debugging.
# It is recommended not to modify this file, since newer versions of Qt Creator
# may offer an updated version of it.
QT += declarative QT += declarative

View File

@@ -1,5 +1,8 @@
# This file should not be edited. # This file was generated by an application wizard of Qt Creator.
# Future versions of Qt Creator might offer updated versions of this file. # The code below handles deployment to Symbian and Maemo, aswell as copying
# of the application data to shadow build directories on desktop.
# It is recommended not to modify this file, since newer versions of Qt Creator
# may offer an updated version of it.
defineTest(qtcAddDeployment) { defineTest(qtcAddDeployment) {
for(deploymentfolder, DEPLOYMENTFOLDERS) { for(deploymentfolder, DEPLOYMENTFOLDERS) {

View File

@@ -68,7 +68,7 @@ const QString AbstractMobileApp::FileStubVersion(QLatin1String("version"));
const int AbstractMobileApp::StubVersion = 1; const int AbstractMobileApp::StubVersion = 1;
AbstractMobileApp::AbstractMobileApp() AbstractMobileApp::AbstractMobileApp()
: m_orientation(Auto), m_networkEnabled(false) : m_orientation(ScreenOrientationAuto), m_networkEnabled(false)
{ {
} }
@@ -85,12 +85,12 @@ QString AbstractMobileApp::symbianUidForPath(const QString &path)
+ QString::fromLatin1("%1").arg(hash, 7, 16, QLatin1Char('0')).right(7).toUpper(); + QString::fromLatin1("%1").arg(hash, 7, 16, QLatin1Char('0')).right(7).toUpper();
} }
void AbstractMobileApp::setOrientation(Orientation orientation) void AbstractMobileApp::setOrientation(ScreenOrientation orientation)
{ {
m_orientation = orientation; m_orientation = orientation;
} }
AbstractMobileApp::Orientation AbstractMobileApp::orientation() const AbstractMobileApp::ScreenOrientation AbstractMobileApp::orientation() const
{ {
return m_orientation; return m_orientation;
} }
@@ -210,14 +210,14 @@ QByteArray AbstractMobileApp::generateMainCpp(QString *errorMessage) const
if (line.contains(QLatin1String("// ORIENTATION"))) { if (line.contains(QLatin1String("// ORIENTATION"))) {
const char *orientationString; const char *orientationString;
switch (orientation()) { switch (orientation()) {
case LockLandscape: case ScreenOrientationLockLandscape:
orientationString = "LockLandscape"; orientationString = "ScreenOrientationLockLandscape";
break; break;
case LockPortrait: case ScreenOrientationLockPortrait:
orientationString = "LockPortrait"; orientationString = "ScreenOrientationLockPortrait";
break; break;
case Auto: case ScreenOrientationAuto:
orientationString = "Auto"; orientationString = "ScreenOrientationAuto";
break; break;
} }
insertParameter(line, mainWindowClassName() + QLatin1String("::") insertParameter(line, mainWindowClassName() + QLatin1String("::")
@@ -258,7 +258,7 @@ QByteArray AbstractMobileApp::generateProFile(QString *errorMessage) const
if (line.contains(QLatin1String("# TARGETUID3"))) { if (line.contains(QLatin1String("# TARGETUID3"))) {
valueOnNextLine = symbianTargetUid(); valueOnNextLine = symbianTargetUid();
} else if (line.contains(QLatin1String("# ORIENTATIONLOCK")) } else if (line.contains(QLatin1String("# ORIENTATIONLOCK"))
&& orientation() == Auto) { && orientation() == ScreenOrientationAuto) {
uncommentNextLine = true; uncommentNextLine = true;
} else if (line.contains(QLatin1String("# NETWORKACCESS")) } else if (line.contains(QLatin1String("# NETWORKACCESS"))
&& !networkEnabled()) { && !networkEnabled()) {

View File

@@ -70,10 +70,10 @@ struct AbstractGeneratedFileInfo
class AbstractMobileApp : public QObject class AbstractMobileApp : public QObject
{ {
public: public:
enum Orientation { enum ScreenOrientation {
LockLandscape, ScreenOrientationLockLandscape,
LockPortrait, ScreenOrientationLockPortrait,
Auto ScreenOrientationAuto
}; };
enum FileType { enum FileType {
@@ -95,8 +95,8 @@ public:
virtual ~AbstractMobileApp(); virtual ~AbstractMobileApp();
void setOrientation(Orientation orientation); void setOrientation(ScreenOrientation orientation);
Orientation orientation() const; ScreenOrientation orientation() const;
void setProjectName(const QString &name); void setProjectName(const QString &name);
QString projectName() const; QString projectName() const;
void setProjectPath(const QString &path); void setProjectPath(const QString &path);
@@ -164,7 +164,7 @@ private:
QString m_symbianSvgIcon; QString m_symbianSvgIcon;
QString m_maemoPngIcon; QString m_maemoPngIcon;
QString m_symbianTargetUid; QString m_symbianTargetUid;
Orientation m_orientation; ScreenOrientation m_orientation;
bool m_networkEnabled; bool m_networkEnabled;
}; };

View File

@@ -60,11 +60,11 @@ MobileAppWizardOptionsPage::MobileAppWizardOptionsPage(QWidget *parent)
SLOT(openMaemoPngIcon())); SLOT(openMaemoPngIcon()));
m_d->ui.orientationBehaviorComboBox->addItem(tr("Automatically Rotate Orientation"), m_d->ui.orientationBehaviorComboBox->addItem(tr("Automatically Rotate Orientation"),
AbstractMobileApp::Auto); AbstractMobileApp::ScreenOrientationAuto);
m_d->ui.orientationBehaviorComboBox->addItem(tr("Lock to Landscape Orientation"), m_d->ui.orientationBehaviorComboBox->addItem(tr("Lock to Landscape Orientation"),
AbstractMobileApp::LockLandscape); AbstractMobileApp::ScreenOrientationLockLandscape);
m_d->ui.orientationBehaviorComboBox->addItem(tr("Lock to Portrait Orientation"), m_d->ui.orientationBehaviorComboBox->addItem(tr("Lock to Portrait Orientation"),
AbstractMobileApp::LockPortrait); AbstractMobileApp::ScreenOrientationLockPortrait);
} }
MobileAppWizardOptionsPage::~MobileAppWizardOptionsPage() MobileAppWizardOptionsPage::~MobileAppWizardOptionsPage()
@@ -72,7 +72,7 @@ MobileAppWizardOptionsPage::~MobileAppWizardOptionsPage()
delete m_d; delete m_d;
} }
void MobileAppWizardOptionsPage::setOrientation(AbstractMobileApp::Orientation orientation) void MobileAppWizardOptionsPage::setOrientation(AbstractMobileApp::ScreenOrientation orientation)
{ {
QComboBox *const comboBox = m_d->ui.orientationBehaviorComboBox; QComboBox *const comboBox = m_d->ui.orientationBehaviorComboBox;
for (int i = 0; i < comboBox->count(); ++i) for (int i = 0; i < comboBox->count(); ++i)
@@ -82,10 +82,10 @@ void MobileAppWizardOptionsPage::setOrientation(AbstractMobileApp::Orientation o
} }
} }
AbstractMobileApp::Orientation MobileAppWizardOptionsPage::orientation() const AbstractMobileApp::ScreenOrientation MobileAppWizardOptionsPage::orientation() const
{ {
const int index = m_d->ui.orientationBehaviorComboBox->currentIndex(); const int index = m_d->ui.orientationBehaviorComboBox->currentIndex();
return static_cast<AbstractMobileApp::Orientation>(m_d->ui.orientationBehaviorComboBox->itemData(index).toInt()); return static_cast<AbstractMobileApp::ScreenOrientation>(m_d->ui.orientationBehaviorComboBox->itemData(index).toInt());
} }
QString MobileAppWizardOptionsPage::symbianSvgIcon() const QString MobileAppWizardOptionsPage::symbianSvgIcon() const

View File

@@ -46,8 +46,8 @@ public:
explicit MobileAppWizardOptionsPage(QWidget *parent = 0); explicit MobileAppWizardOptionsPage(QWidget *parent = 0);
virtual ~MobileAppWizardOptionsPage(); virtual ~MobileAppWizardOptionsPage();
void setOrientation(AbstractMobileApp::Orientation orientation); void setOrientation(AbstractMobileApp::ScreenOrientation orientation);
AbstractMobileApp::Orientation orientation() const; AbstractMobileApp::ScreenOrientation orientation() const;
QString symbianSvgIcon() const; QString symbianSvgIcon() const;
void setSymbianSvgIcon(const QString &icon); void setSymbianSvgIcon(const QString &icon);
QString maemoPngIcon() const; QString maemoPngIcon() const;