diff options
author | artoka <arto.katajasalo@digia.com> | 2011-11-17 14:50:05 (GMT) |
---|---|---|
committer | Casper van Donderen <casper.vandonderen@nokia.com> | 2011-11-17 14:59:54 (GMT) |
commit | f38788d08bcb7c50f5ce29255792a35f6ad2bb16 (patch) | |
tree | 5e76354ebd7f8794ea78782d56992bfefc741e07 /examples | |
parent | 5c2f5bf955e5c5a37c59f64ae05d816416c3f1ac (diff) | |
download | Qt-f38788d08bcb7c50f5ce29255792a35f6ad2bb16.zip Qt-f38788d08bcb7c50f5ce29255792a35f6ad2bb16.tar.gz Qt-f38788d08bcb7c50f5ce29255792a35f6ad2bb16.tar.bz2 |
ui-components/main example modifications
Modified the example to use centralized qmlapplicationviewer,
removed duplicate files and modified project files according
to the changes.
Merge-request: 2719
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/declarative/ui-components/main/main.cpp | 2 | ||||
-rw-r--r-- | examples/declarative/ui-components/main/main.pro | 4 | ||||
-rw-r--r-- | examples/declarative/ui-components/main/main.qmlproject (renamed from examples/declarative/ui-components/main/qml/spinner.qmlproject) | 6 | ||||
-rw-r--r-- | examples/declarative/ui-components/main/qml/main/ScrollBar.qml (renamed from examples/declarative/ui-components/main/qml/ScrollBar.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/main/qml/main/SearchBox.qml (renamed from examples/declarative/ui-components/main/qml/SearchBox.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/main/qml/main/TabWidget.qml (renamed from examples/declarative/ui-components/main/qml/TabWidget.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/main/qml/main/content/ProgressBar.qml (renamed from examples/declarative/ui-components/main/qml/content/ProgressBar.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/main/qml/main/content/Spinner.qml (renamed from examples/declarative/ui-components/main/qml/content/Spinner.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/main/qml/main/content/background.png (renamed from examples/declarative/ui-components/main/qml/content/background.png) | bin | 426 -> 426 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/main/qml/main/content/spinner-bg.png (renamed from examples/declarative/ui-components/main/qml/content/spinner-bg.png) | bin | 345 -> 345 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/main/qml/main/content/spinner-select.png (renamed from examples/declarative/ui-components/main/qml/content/spinner-select.png) | bin | 320 -> 320 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/main/qml/main/images/clear.png (renamed from examples/declarative/ui-components/main/qml/images/clear.png) | bin | 429 -> 429 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/main/qml/main/images/lineedit-bg-focus.png (renamed from examples/declarative/ui-components/main/qml/images/lineedit-bg-focus.png) | bin | 526 -> 526 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/main/qml/main/images/lineedit-bg.png (renamed from examples/declarative/ui-components/main/qml/images/lineedit-bg.png) | bin | 426 -> 426 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/main/qml/main/main.qml (renamed from examples/declarative/ui-components/main/qml/main.qml) | 0 | ||||
-rw-r--r-- | examples/declarative/ui-components/main/qml/main/pics/niagara_falls.jpg (renamed from examples/declarative/ui-components/main/qml/pics/niagara_falls.jpg) | bin | 100161 -> 100161 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/main/qml/main/tab.png (renamed from examples/declarative/ui-components/main/qml/tab.png) | bin | 507 -> 507 bytes | |||
-rw-r--r-- | examples/declarative/ui-components/main/qml/progressbar.qmlproject | 16 | ||||
-rw-r--r-- | examples/declarative/ui-components/main/qml/scrollbar.qmlproject | 16 | ||||
-rw-r--r-- | examples/declarative/ui-components/main/qml/searchbox.qmlproject | 16 | ||||
-rw-r--r-- | examples/declarative/ui-components/main/qml/tabwidget.qmlproject | 16 | ||||
-rw-r--r-- | examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.cpp | 197 | ||||
-rw-r--r-- | examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.h | 79 | ||||
-rw-r--r-- | examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.pri | 154 |
24 files changed, 6 insertions, 500 deletions
diff --git a/examples/declarative/ui-components/main/main.cpp b/examples/declarative/ui-components/main/main.cpp index d60f16d..29adb15 100644 --- a/examples/declarative/ui-components/main/main.cpp +++ b/examples/declarative/ui-components/main/main.cpp @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) QmlApplicationViewer viewer; viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); - viewer.setMainQmlFile(QLatin1String("qml/qml/main.qml")); + viewer.setMainQmlFile(QLatin1String("qml/main/main.qml")); viewer.showExpanded(); return app.exec(); diff --git a/examples/declarative/ui-components/main/main.pro b/examples/declarative/ui-components/main/main.pro index cf172ab..60b0ed5 100644 --- a/examples/declarative/ui-components/main/main.pro +++ b/examples/declarative/ui-components/main/main.pro @@ -1,5 +1,5 @@ # Add more folders to ship with the application, here -folder_01.source = qml +folder_01.source = qml/main folder_01.target = qml DEPLOYMENTFOLDERS = folder_01 @@ -35,5 +35,5 @@ symbian:TARGET.UID3 = 0xE647B679 SOURCES += main.cpp # Please do not modify the following two lines. Required for deployment. -include(qmlapplicationviewer/qmlapplicationviewer.pri) +include(../../../tools/qmlapplicationviewer/qmlapplicationviewer.pri) qtcAddDeployment() diff --git a/examples/declarative/ui-components/main/qml/spinner.qmlproject b/examples/declarative/ui-components/main/main.qmlproject index d4909f8..91ddfd4 100644 --- a/examples/declarative/ui-components/main/qml/spinner.qmlproject +++ b/examples/declarative/ui-components/main/main.qmlproject @@ -3,13 +3,13 @@ import QmlProject 1.0 Project { /* Include .qml, .js, and image files from current directory and subdirectories */ QmlFiles { - directory: "." + directory: "qml/main" } JavaScriptFiles { - directory: "." + directory: "qml/main" } ImageFiles { - directory: "." + directory: "qml/main" } /* List of plugin directories passed to QML runtime */ // importPaths: [ " ../exampleplugin " ] diff --git a/examples/declarative/ui-components/main/qml/ScrollBar.qml b/examples/declarative/ui-components/main/qml/main/ScrollBar.qml index faa501a..faa501a 100644 --- a/examples/declarative/ui-components/main/qml/ScrollBar.qml +++ b/examples/declarative/ui-components/main/qml/main/ScrollBar.qml diff --git a/examples/declarative/ui-components/main/qml/SearchBox.qml b/examples/declarative/ui-components/main/qml/main/SearchBox.qml index f54954a..f54954a 100644 --- a/examples/declarative/ui-components/main/qml/SearchBox.qml +++ b/examples/declarative/ui-components/main/qml/main/SearchBox.qml diff --git a/examples/declarative/ui-components/main/qml/TabWidget.qml b/examples/declarative/ui-components/main/qml/main/TabWidget.qml index f066fd2..f066fd2 100644 --- a/examples/declarative/ui-components/main/qml/TabWidget.qml +++ b/examples/declarative/ui-components/main/qml/main/TabWidget.qml diff --git a/examples/declarative/ui-components/main/qml/content/ProgressBar.qml b/examples/declarative/ui-components/main/qml/main/content/ProgressBar.qml index e92342a..e92342a 100644 --- a/examples/declarative/ui-components/main/qml/content/ProgressBar.qml +++ b/examples/declarative/ui-components/main/qml/main/content/ProgressBar.qml diff --git a/examples/declarative/ui-components/main/qml/content/Spinner.qml b/examples/declarative/ui-components/main/qml/main/content/Spinner.qml index 853c787..853c787 100644 --- a/examples/declarative/ui-components/main/qml/content/Spinner.qml +++ b/examples/declarative/ui-components/main/qml/main/content/Spinner.qml diff --git a/examples/declarative/ui-components/main/qml/content/background.png b/examples/declarative/ui-components/main/qml/main/content/background.png Binary files differindex 9044226..9044226 100644 --- a/examples/declarative/ui-components/main/qml/content/background.png +++ b/examples/declarative/ui-components/main/qml/main/content/background.png diff --git a/examples/declarative/ui-components/main/qml/content/spinner-bg.png b/examples/declarative/ui-components/main/qml/main/content/spinner-bg.png Binary files differindex b3556f1..b3556f1 100644 --- a/examples/declarative/ui-components/main/qml/content/spinner-bg.png +++ b/examples/declarative/ui-components/main/qml/main/content/spinner-bg.png diff --git a/examples/declarative/ui-components/main/qml/content/spinner-select.png b/examples/declarative/ui-components/main/qml/main/content/spinner-select.png Binary files differindex 95a17a1..95a17a1 100644 --- a/examples/declarative/ui-components/main/qml/content/spinner-select.png +++ b/examples/declarative/ui-components/main/qml/main/content/spinner-select.png diff --git a/examples/declarative/ui-components/main/qml/images/clear.png b/examples/declarative/ui-components/main/qml/main/images/clear.png Binary files differindex 91eb270..91eb270 100644 --- a/examples/declarative/ui-components/main/qml/images/clear.png +++ b/examples/declarative/ui-components/main/qml/main/images/clear.png diff --git a/examples/declarative/ui-components/main/qml/images/lineedit-bg-focus.png b/examples/declarative/ui-components/main/qml/main/images/lineedit-bg-focus.png Binary files differindex bbfac38..bbfac38 100644 --- a/examples/declarative/ui-components/main/qml/images/lineedit-bg-focus.png +++ b/examples/declarative/ui-components/main/qml/main/images/lineedit-bg-focus.png diff --git a/examples/declarative/ui-components/main/qml/images/lineedit-bg.png b/examples/declarative/ui-components/main/qml/main/images/lineedit-bg.png Binary files differindex 9044226..9044226 100644 --- a/examples/declarative/ui-components/main/qml/images/lineedit-bg.png +++ b/examples/declarative/ui-components/main/qml/main/images/lineedit-bg.png diff --git a/examples/declarative/ui-components/main/qml/main.qml b/examples/declarative/ui-components/main/qml/main/main.qml index 842ef1a..842ef1a 100644 --- a/examples/declarative/ui-components/main/qml/main.qml +++ b/examples/declarative/ui-components/main/qml/main/main.qml diff --git a/examples/declarative/ui-components/main/qml/pics/niagara_falls.jpg b/examples/declarative/ui-components/main/qml/main/pics/niagara_falls.jpg Binary files differindex d255543..d255543 100644 --- a/examples/declarative/ui-components/main/qml/pics/niagara_falls.jpg +++ b/examples/declarative/ui-components/main/qml/main/pics/niagara_falls.jpg diff --git a/examples/declarative/ui-components/main/qml/tab.png b/examples/declarative/ui-components/main/qml/main/tab.png Binary files differindex ad80216..ad80216 100644 --- a/examples/declarative/ui-components/main/qml/tab.png +++ b/examples/declarative/ui-components/main/qml/main/tab.png diff --git a/examples/declarative/ui-components/main/qml/progressbar.qmlproject b/examples/declarative/ui-components/main/qml/progressbar.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/ui-components/main/qml/progressbar.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/ui-components/main/qml/scrollbar.qmlproject b/examples/declarative/ui-components/main/qml/scrollbar.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/ui-components/main/qml/scrollbar.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/ui-components/main/qml/searchbox.qmlproject b/examples/declarative/ui-components/main/qml/searchbox.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/ui-components/main/qml/searchbox.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/ui-components/main/qml/tabwidget.qmlproject b/examples/declarative/ui-components/main/qml/tabwidget.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/ui-components/main/qml/tabwidget.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index 411a04c..0000000 --- a/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// checksum 0x28c7 version 0x2000a -/* - 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 <QtCore/QCoreApplication> -#include <QtCore/QDir> -#include <QtCore/QFileInfo> -#include <QtDeclarative/QDeclarativeComponent> -#include <QtDeclarative/QDeclarativeEngine> -#include <QtDeclarative/QDeclarativeContext> - -#if defined(QMLJSDEBUGGER) -#include <qt_private/qdeclarativedebughelper_p.h> -#endif - -#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) -#include <jsdebuggeragent.h> -#endif -#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) -#include <qdeclarativeviewobserver.h> -#endif - -#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) -#include <eikenv.h> -#include <eikappui.h> -#include <aknenv.h> -#include <aknappui.h> -#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK - -#if defined(QMLJSDEBUGGER) - -// Enable debugging before any QDeclarativeEngine is created -struct QmlJsDebuggingEnabler -{ - QmlJsDebuggingEnabler() - { - QDeclarativeDebugHelper::enableDebugging(); - } -}; - -// Execute code in constructor before first QDeclarativeEngine is instantiated -static QmlJsDebuggingEnabler enableDebuggingHelper; - -#endif // QMLJSDEBUGGER - -class QmlApplicationViewerPrivate -{ - QString mainQmlFile; - friend class QmlApplicationViewer; - static QString adjustPath(const QString &path); -}; - -QString QmlApplicationViewerPrivate::adjustPath(const QString &path) -{ -#ifdef Q_OS_UNIX -#ifdef Q_OS_MAC - if (!QDir::isAbsolutePath(path)) - return QCoreApplication::applicationDirPath() - + QLatin1String("/../Resources/") + path; -#else - const QString pathInShareDir = QCoreApplication::applicationDirPath() - + QLatin1String("/../share/") - + QFileInfo(QCoreApplication::applicationFilePath()).fileName() - + QLatin1Char('/') + path; - if (QFileInfo(pathInShareDir).exists()) - return pathInShareDir; -#endif -#endif - return path; -} - -QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) : - QDeclarativeView(parent), - m_d(new QmlApplicationViewerPrivate) -{ - connect(engine(), SIGNAL(quit()), SLOT(close())); - setResizeMode(QDeclarativeView::SizeRootObjectToView); -#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) - new QmlJSDebugger::JSDebuggerAgent(engine()); -#endif -#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) - new QmlJSDebugger::QDeclarativeViewObserver(this, parent); -#endif -} - -QmlApplicationViewer::~QmlApplicationViewer() -{ - delete m_d; -} - -void QmlApplicationViewer::setMainQmlFile(const QString &file) -{ - m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file); - setSource(QUrl::fromLocalFile(m_d->mainQmlFile)); -} - -void QmlApplicationViewer::addImportPath(const QString &path) -{ - engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path)); -} - -void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) -{ -#ifdef Q_OS_SYMBIAN - if (orientation != ScreenOrientationAuto) { -#if defined(ORIENTATIONLOCK) - const CAknAppUiBase::TAppUiOrientation uiOrientation = - (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait - : CAknAppUi::EAppUiOrientationLandscape; - CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (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 - } -#elif defined(Q_WS_MAEMO_5) - Qt::WidgetAttribute attribute; - switch (orientation) { - case ScreenOrientationLockPortrait: - attribute = Qt::WA_Maemo5PortraitOrientation; - break; - case ScreenOrientationLockLandscape: - attribute = Qt::WA_Maemo5LandscapeOrientation; - break; - case ScreenOrientationAuto: - default: - attribute = Qt::WA_Maemo5AutoOrientation; - break; - } - setAttribute(attribute, true); -#else // Q_OS_SYMBIAN - Q_UNUSED(orientation); -#endif // Q_OS_SYMBIAN -} - -void QmlApplicationViewer::showExpanded() -{ -#ifdef Q_OS_SYMBIAN - showFullScreen(); -#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) - showMaximized(); -#else - show(); -#endif -} diff --git a/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index f5b24b0..0000000 --- a/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// checksum 0x5a59 version 0x2000a -/* - 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 -#define QMLAPPLICATIONVIEWER_H - -#include <QtDeclarative/QDeclarativeView> - -class QmlApplicationViewer : public QDeclarativeView -{ - Q_OBJECT - -public: - enum ScreenOrientation { - ScreenOrientationLockPortrait, - ScreenOrientationLockLandscape, - ScreenOrientationAuto - }; - - explicit QmlApplicationViewer(QWidget *parent = 0); - virtual ~QmlApplicationViewer(); - - void setMainQmlFile(const QString &file); - void addImportPath(const QString &path); - void setOrientation(ScreenOrientation orientation); - void showExpanded(); - -private: - class QmlApplicationViewerPrivate *m_d; -}; - -#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.pri deleted file mode 100644 index 1c0c7ed..0000000 --- a/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,154 +0,0 @@ -# checksum 0x3dc8 version 0x2000a -# This file was generated by the Qt Quick Application wizard of Qt Creator. -# 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 - -SOURCES += $$PWD/qmlapplicationviewer.cpp -HEADERS += $$PWD/qmlapplicationviewer.h -INCLUDEPATH += $$PWD - -defineTest(minQtVersion) { - maj = $$1 - min = $$2 - patch = $$3 - isEqual(QT_MAJOR_VERSION, $$maj) { - isEqual(QT_MINOR_VERSION, $$min) { - isEqual(QT_PATCH_VERSION, $$patch) { - return(true) - } - greaterThan(QT_PATCH_VERSION, $$patch) { - return(true) - } - } - greaterThan(QT_MINOR_VERSION, $$min) { - return(true) - } - } - return(false) -} - -contains(DEFINES, QMLJSDEBUGGER) { - CONFIG(debug, debug|release) { - !minQtVersion(4, 7, 1) { - warning() - warning("Disabling QML debugging:") - warning() - warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") - warning("This library requires Qt 4.7.1 or newer.") - warning() - DEFINES -= QMLJSDEBUGGER - } else:isEmpty(QMLJSDEBUGGER_PATH) { - warning() - warning("Disabling QML debugging:") - warning() - warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") - warning("Please specify its location on the qmake command line, eg") - warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") - warning() - DEFINES -= QMLJSDEBUGGER - } else { - include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) - } - } else { - DEFINES -= QMLJSDEBUGGER - } -} -# This file was generated by an application wizard of Qt Creator. -# 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) { -for(deploymentfolder, DEPLOYMENTFOLDERS) { - item = item$${deploymentfolder} - itemsources = $${item}.sources - $$itemsources = $$eval($${deploymentfolder}.source) - itempath = $${item}.path - $$itempath= $$eval($${deploymentfolder}.target) - export($$itemsources) - export($$itempath) - DEPLOYMENT += $$item -} - -MAINPROFILEPWD = $$PWD - -symbian { - ICON = $${TARGET}.svg - TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 - contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone - contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices -} else:win32 { - !isEqual(PWD,$$OUT_PWD) { - copyCommand = @echo Copying application data... - for(deploymentfolder, DEPLOYMENTFOLDERS) { - source = $$eval($${deploymentfolder}.source) - pathSegments = $$split(source, /) - sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) - copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) - } - copydeploymentfolders.commands = $$copyCommand - first.depends = $(first) copydeploymentfolders - export(first.depends) - export(copydeploymentfolders.commands) - QMAKE_EXTRA_TARGETS += first copydeploymentfolders - } -} else:unix { - maemo5 { - installPrefix = /opt/usr - desktopfile.path = /usr/share/applications/hildon - } else { - installPrefix = /usr/local - desktopfile.path = /usr/share/applications - !isEqual(PWD,$$OUT_PWD) { - copyCommand = @echo Copying application data... - for(deploymentfolder, DEPLOYMENTFOLDERS) { - macx { - target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) - } else { - target = $$OUT_PWD/$$eval($${deploymentfolder}.target) - } - copyCommand += && $(MKDIR) $$target - copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target - } - copydeploymentfolders.commands = $$copyCommand - first.depends = $(first) copydeploymentfolders - export(first.depends) - export(copydeploymentfolders.commands) - QMAKE_EXTRA_TARGETS += first copydeploymentfolders - } - } - for(deploymentfolder, DEPLOYMENTFOLDERS) { - item = item$${deploymentfolder} - itemfiles = $${item}.files - $$itemfiles = $$eval($${deploymentfolder}.source) - itempath = $${item}.path - $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target) - export($$itemfiles) - export($$itempath) - INSTALLS += $$item - } - icon.files = $${TARGET}.png - icon.path = /usr/share/icons/hicolor/64x64/apps - desktopfile.files = $${TARGET}.desktop - target.path = $${installPrefix}/bin - export(icon.files) - export(icon.path) - export(desktopfile.files) - export(desktopfile.path) - export(target.path) - INSTALLS += desktopfile icon target -} - -export (ICON) -export (INSTALLS) -export (DEPLOYMENT) -export (TARGET.EPOCHEAPSIZE) -export (TARGET.CAPABILITY) -export (LIBS) -export (QMAKE_EXTRA_TARGETS) -} |