diff options
author | artoka <arto.katajasalo@digia.com> | 2011-11-17 14:49:54 (GMT) |
---|---|---|
committer | Casper van Donderen <casper.vandonderen@nokia.com> | 2011-11-17 14:58:49 (GMT) |
commit | 0cf48a31c5d67229d18ddab872c9a58daa021943 (patch) | |
tree | 44ebad4d86cde88dc49766ba0f075abdcd3bcf83 /examples/declarative | |
parent | f65bf7667c8ac651f54c81e78a3122acd649ffdd (diff) | |
download | Qt-0cf48a31c5d67229d18ddab872c9a58daa021943.zip Qt-0cf48a31c5d67229d18ddab872c9a58daa021943.tar.gz Qt-0cf48a31c5d67229d18ddab872c9a58daa021943.tar.bz2 |
Modelviews Examples Modifications
modelviews/webview/ alerts, autosize, googlemaps, inlinehtml and
newwindows example modifications
Modified examples 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/declarative')
92 files changed, 43 insertions, 2625 deletions
diff --git a/examples/declarative/modelviews/webview/alerts.qml b/examples/declarative/modelviews/webview/alerts.qml deleted file mode 100644 index 5acf0e0..0000000 --- a/examples/declarative/modelviews/webview/alerts.qml +++ /dev/null @@ -1,101 +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 examples 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$ -** -****************************************************************************/ - -import QtQuick 1.0 -import QtWebKit 1.0 - -WebView { - id: webView - width: 200 - height: 150 - url: "alerts.html" - - onAlert: popup.show(message) - - Rectangle { - id: popup - - color: "red" - border.color: "black"; border.width: 2 - radius: 4 - - y: parent.height // off "screen" - anchors.horizontalCenter: parent.horizontalCenter - width: label.width + 5 - height: label.height + 5 - - opacity: 0 - - function show(text) { - label.text = text - popup.state = "visible" - timer.start() - } - states: State { - name: "visible" - PropertyChanges { target: popup; opacity: 1 } - PropertyChanges { target: popup; y: (webView.height-popup.height)/2 } - } - - transitions: [ - Transition { from: ""; PropertyAnimation { properties: "opacity,y"; duration: 65 } }, - Transition { from: "visible"; PropertyAnimation { properties: "opacity,y"; duration: 500 } } - ] - - Timer { - id: timer - interval: 1000 - - onTriggered: popup.state = "" - } - - Text { - id: label - anchors.centerIn: parent - width: webView.width *0.75 - - color: "white" - font.pixelSize: 20 - wrapMode: Text.WordWrap - horizontalAlignment: Text.AlignHCenter - smooth: true - } - } -} diff --git a/examples/declarative/modelviews/webview/alerts/alerts.pro b/examples/declarative/modelviews/webview/alerts/alerts.pro index 335c3a3..1de3858 100644 --- a/examples/declarative/modelviews/webview/alerts/alerts.pro +++ b/examples/declarative/modelviews/webview/alerts/alerts.pro @@ -1,5 +1,5 @@ # Add more folders to ship with the application, here -folder_01.source = qml +folder_01.source = qml/alerts folder_01.target = qml DEPLOYMENTFOLDERS = folder_01 @@ -35,5 +35,5 @@ symbian:TARGET.UID3 = 0xE14997C0 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/modelviews/webview/alerts/qml/webview.qmlproject b/examples/declarative/modelviews/webview/alerts/alerts.qmlproject index d4909f8..f186840 100644 --- a/examples/declarative/modelviews/webview/alerts/qml/webview.qmlproject +++ b/examples/declarative/modelviews/webview/alerts/alerts.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/alerts" } JavaScriptFiles { - directory: "." + directory: "qml/alerts" } ImageFiles { - directory: "." + directory: "qml/alerts" } /* List of plugin directories passed to QML runtime */ // importPaths: [ " ../exampleplugin " ] diff --git a/examples/declarative/modelviews/webview/alerts/main.cpp b/examples/declarative/modelviews/webview/alerts/main.cpp index e57f541..8fbc0e5 100644 --- a/examples/declarative/modelviews/webview/alerts/main.cpp +++ b/examples/declarative/modelviews/webview/alerts/main.cpp @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) QmlApplicationViewer viewer; viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); - viewer.setMainQmlFile(QLatin1String("qml/qml/alerts.qml")); + viewer.setMainQmlFile(QLatin1String("qml/alerts/alerts.qml")); viewer.showExpanded(); return app.exec(); diff --git a/examples/declarative/modelviews/webview/newwindows/qml/alerts.html b/examples/declarative/modelviews/webview/alerts/qml/alerts/alerts.html index 82caddf..82caddf 100644 --- a/examples/declarative/modelviews/webview/newwindows/qml/alerts.html +++ b/examples/declarative/modelviews/webview/alerts/qml/alerts/alerts.html diff --git a/examples/declarative/modelviews/webview/newwindows/qml/alerts.qml b/examples/declarative/modelviews/webview/alerts/qml/alerts/alerts.qml index 4aa4a3b..4aa4a3b 100644 --- a/examples/declarative/modelviews/webview/newwindows/qml/alerts.qml +++ b/examples/declarative/modelviews/webview/alerts/qml/alerts/alerts.qml diff --git a/examples/declarative/modelviews/webview/newwindows/qml/autosize.qml b/examples/declarative/modelviews/webview/alerts/qml/alerts/autosize.qml index 7e10403..7e10403 100644 --- a/examples/declarative/modelviews/webview/newwindows/qml/autosize.qml +++ b/examples/declarative/modelviews/webview/alerts/qml/alerts/autosize.qml diff --git a/examples/declarative/modelviews/webview/newwindows/qml/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/alerts/qml/alerts/content/Mapping/Map.qml index 9a86579..9a86579 100644 --- a/examples/declarative/modelviews/webview/newwindows/qml/content/Mapping/Map.qml +++ b/examples/declarative/modelviews/webview/alerts/qml/alerts/content/Mapping/Map.qml diff --git a/examples/declarative/modelviews/webview/newwindows/qml/content/Mapping/map.html b/examples/declarative/modelviews/webview/alerts/qml/alerts/content/Mapping/map.html index a98da54..a98da54 100644 --- a/examples/declarative/modelviews/webview/newwindows/qml/content/Mapping/map.html +++ b/examples/declarative/modelviews/webview/alerts/qml/alerts/content/Mapping/map.html diff --git a/examples/declarative/modelviews/webview/newwindows/qml/content/pics/cancel.png b/examples/declarative/modelviews/webview/alerts/qml/alerts/content/pics/cancel.png Binary files differindex ecc9533..ecc9533 100644 --- a/examples/declarative/modelviews/webview/newwindows/qml/content/pics/cancel.png +++ b/examples/declarative/modelviews/webview/alerts/qml/alerts/content/pics/cancel.png diff --git a/examples/declarative/modelviews/webview/newwindows/qml/content/pics/ok.png b/examples/declarative/modelviews/webview/alerts/qml/alerts/content/pics/ok.png Binary files differindex 5795f04..5795f04 100644 --- a/examples/declarative/modelviews/webview/newwindows/qml/content/pics/ok.png +++ b/examples/declarative/modelviews/webview/alerts/qml/alerts/content/pics/ok.png diff --git a/examples/declarative/modelviews/webview/newwindows/qml/googlemaps.qml b/examples/declarative/modelviews/webview/alerts/qml/alerts/googlemaps.qml index aed0ddd..aed0ddd 100644 --- a/examples/declarative/modelviews/webview/newwindows/qml/googlemaps.qml +++ b/examples/declarative/modelviews/webview/alerts/qml/alerts/googlemaps.qml diff --git a/examples/declarative/modelviews/webview/newwindows/qml/inlinehtml.qml b/examples/declarative/modelviews/webview/alerts/qml/alerts/inlinehtml.qml index afc1fa9..afc1fa9 100644 --- a/examples/declarative/modelviews/webview/newwindows/qml/inlinehtml.qml +++ b/examples/declarative/modelviews/webview/alerts/qml/alerts/inlinehtml.qml diff --git a/examples/declarative/modelviews/webview/newwindows/qml/newwindows.html b/examples/declarative/modelviews/webview/alerts/qml/alerts/newwindows.html index f169599..f169599 100644 --- a/examples/declarative/modelviews/webview/newwindows/qml/newwindows.html +++ b/examples/declarative/modelviews/webview/alerts/qml/alerts/newwindows.html diff --git a/examples/declarative/modelviews/webview/newwindows/qml/newwindows.qml b/examples/declarative/modelviews/webview/alerts/qml/alerts/newwindows.qml index 52f7a0b..52f7a0b 100644 --- a/examples/declarative/modelviews/webview/newwindows/qml/newwindows.qml +++ b/examples/declarative/modelviews/webview/alerts/qml/alerts/newwindows.qml diff --git a/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index 411a04c..0000000 --- a/examples/declarative/modelviews/webview/alerts/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/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index f5b24b0..0000000 --- a/examples/declarative/modelviews/webview/alerts/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/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.pri deleted file mode 100644 index 1c0c7ed..0000000 --- a/examples/declarative/modelviews/webview/alerts/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) -} diff --git a/examples/declarative/modelviews/webview/autosize.qml b/examples/declarative/modelviews/webview/autosize.qml deleted file mode 100644 index d7d6764..0000000 --- a/examples/declarative/modelviews/webview/autosize.qml +++ /dev/null @@ -1,106 +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 examples 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$ -** -****************************************************************************/ - -import QtQuick 1.0 -import QtWebKit 1.0 - -// The WebView size is determined by the width, height, -// preferredWidth, and preferredHeight properties. -Rectangle { - id: rect - width: 200 - height: layout.height - - Column { - id: layout - spacing: 2 - - WebView { - html: "No width defined." - Rectangle { - color: "#10000000" - anchors.fill: parent - } - } - - WebView { - width: rect.width - html: "The width is full." - Rectangle { - color: "#10000000" - anchors.fill: parent - } - } - - WebView { - width: rect.width/2 - html: "The width is half." - Rectangle { - color: "#10000000" - anchors.fill: parent - } - } - WebView { - width: rect.width/2 - html: "The_width_is_half." // not wrapped - Rectangle { - color: "#10000000" - anchors.fill: parent - } - } - - WebView { - preferredWidth: rect.width/2 - html: "The preferredWidth is half." - Rectangle { - color: "#10000000" - anchors.fill: parent - } - } - WebView { - preferredWidth: rect.width/2 - html: "The_preferredWidth_is_half." // not wrapped - Rectangle { - color: "#10000000" - anchors.fill: parent - } - } - } -} diff --git a/examples/declarative/modelviews/webview/autosize/autosize.pro b/examples/declarative/modelviews/webview/autosize/autosize.pro index a17f822..13913c6 100644 --- a/examples/declarative/modelviews/webview/autosize/autosize.pro +++ b/examples/declarative/modelviews/webview/autosize/autosize.pro @@ -1,5 +1,5 @@ # Add more folders to ship with the application, here -folder_01.source = qml +folder_01.source = qml/autosize folder_01.target = qml DEPLOYMENTFOLDERS = folder_01 @@ -35,5 +35,5 @@ symbian:TARGET.UID3 = 0xEE6AB317 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/modelviews/webview/autosize/qml/webview.qmlproject b/examples/declarative/modelviews/webview/autosize/autosize.qmlproject index d4909f8..f1bf807 100644 --- a/examples/declarative/modelviews/webview/autosize/qml/webview.qmlproject +++ b/examples/declarative/modelviews/webview/autosize/autosize.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/autosize" } JavaScriptFiles { - directory: "." + directory: "qml/autosize" } ImageFiles { - directory: "." + directory: "qml/autosize" } /* List of plugin directories passed to QML runtime */ // importPaths: [ " ../exampleplugin " ] diff --git a/examples/declarative/modelviews/webview/autosize/main.cpp b/examples/declarative/modelviews/webview/autosize/main.cpp index 9a7f6ec..86fdd6c 100644 --- a/examples/declarative/modelviews/webview/autosize/main.cpp +++ b/examples/declarative/modelviews/webview/autosize/main.cpp @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) QmlApplicationViewer viewer; viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait); - viewer.setMainQmlFile(QLatin1String("qml/qml/autosize.qml")); + viewer.setMainQmlFile(QLatin1String("qml/autosize/autosize.qml")); viewer.showExpanded(); return app.exec(); diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/alerts.html b/examples/declarative/modelviews/webview/autosize/qml/autosize/alerts.html index 82caddf..82caddf 100644 --- a/examples/declarative/modelviews/webview/inlinehtml/qml/alerts.html +++ b/examples/declarative/modelviews/webview/autosize/qml/autosize/alerts.html diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/alerts.qml b/examples/declarative/modelviews/webview/autosize/qml/autosize/alerts.qml index 4aa4a3b..4aa4a3b 100644 --- a/examples/declarative/modelviews/webview/inlinehtml/qml/alerts.qml +++ b/examples/declarative/modelviews/webview/autosize/qml/autosize/alerts.qml diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/autosize.qml b/examples/declarative/modelviews/webview/autosize/qml/autosize/autosize.qml index 7e10403..7e10403 100644 --- a/examples/declarative/modelviews/webview/inlinehtml/qml/autosize.qml +++ b/examples/declarative/modelviews/webview/autosize/qml/autosize/autosize.qml diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/autosize/qml/autosize/content/Mapping/Map.qml index 9a86579..9a86579 100644 --- a/examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/Map.qml +++ b/examples/declarative/modelviews/webview/autosize/qml/autosize/content/Mapping/Map.qml diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/map.html b/examples/declarative/modelviews/webview/autosize/qml/autosize/content/Mapping/map.html index a98da54..a98da54 100644 --- a/examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/map.html +++ b/examples/declarative/modelviews/webview/autosize/qml/autosize/content/Mapping/map.html diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/cancel.png b/examples/declarative/modelviews/webview/autosize/qml/autosize/content/pics/cancel.png Binary files differindex ecc9533..ecc9533 100644 --- a/examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/cancel.png +++ b/examples/declarative/modelviews/webview/autosize/qml/autosize/content/pics/cancel.png diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/ok.png b/examples/declarative/modelviews/webview/autosize/qml/autosize/content/pics/ok.png Binary files differindex 5795f04..5795f04 100644 --- a/examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/ok.png +++ b/examples/declarative/modelviews/webview/autosize/qml/autosize/content/pics/ok.png diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/googlemaps.qml b/examples/declarative/modelviews/webview/autosize/qml/autosize/googlemaps.qml index aed0ddd..aed0ddd 100644 --- a/examples/declarative/modelviews/webview/inlinehtml/qml/googlemaps.qml +++ b/examples/declarative/modelviews/webview/autosize/qml/autosize/googlemaps.qml diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml.qml b/examples/declarative/modelviews/webview/autosize/qml/autosize/inlinehtml.qml index afc1fa9..afc1fa9 100644 --- a/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml.qml +++ b/examples/declarative/modelviews/webview/autosize/qml/autosize/inlinehtml.qml diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.html b/examples/declarative/modelviews/webview/autosize/qml/autosize/newwindows.html index f169599..f169599 100644 --- a/examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.html +++ b/examples/declarative/modelviews/webview/autosize/qml/autosize/newwindows.html diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.qml b/examples/declarative/modelviews/webview/autosize/qml/autosize/newwindows.qml index 52f7a0b..52f7a0b 100644 --- a/examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.qml +++ b/examples/declarative/modelviews/webview/autosize/qml/autosize/newwindows.qml diff --git a/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index 411a04c..0000000 --- a/examples/declarative/modelviews/webview/autosize/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/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index f5b24b0..0000000 --- a/examples/declarative/modelviews/webview/autosize/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/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.pri deleted file mode 100644 index 1c0c7ed..0000000 --- a/examples/declarative/modelviews/webview/autosize/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) -} diff --git a/examples/declarative/modelviews/webview/googlemaps.qml b/examples/declarative/modelviews/webview/googlemaps.qml deleted file mode 100644 index 85641f4..0000000 --- a/examples/declarative/modelviews/webview/googlemaps.qml +++ /dev/null @@ -1,83 +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 examples 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$ -** -****************************************************************************/ - -// This example demonstrates how Web services such as Google Maps can be -// abstracted as QML types. Here we have a "Mapping" module with a "Map" -// type. The Map type has an address property. Setting that property moves -// the map. The underlying implementation uses WebView and the Google Maps -// API, but users from QML don't need to understand the implementation in -// order to create a Map. - -import QtQuick 1.0 -import QtWebKit 1.0 -import "content/Mapping" - -Map { - id: map - width: 300 - height: 300 - address: "Paris" - - Rectangle { - x: 70 - width: input.width + 20 - height: input.height + 4 - anchors.bottom: parent.bottom; anchors.bottomMargin: 5 - radius: 5 - opacity: map.status == "Ready" ? 1 : 0 - - TextInput { - id: input - text: map.address - anchors.centerIn: parent - Keys.onReturnPressed: map.address = input.text - } - } - - Text { - id: loading - anchors.centerIn: parent - text: map.status == "Error" ? "Error" : "Loading" - opacity: map.status == "Ready" ? 0 : 1 - font.pixelSize: 30 - - Behavior on opacity { NumberAnimation{} } - } -} diff --git a/examples/declarative/modelviews/webview/googlemaps/googlemaps.pro b/examples/declarative/modelviews/webview/googlemaps/googlemaps.pro index 2a4c5f2..2bbfbf5 100644 --- a/examples/declarative/modelviews/webview/googlemaps/googlemaps.pro +++ b/examples/declarative/modelviews/webview/googlemaps/googlemaps.pro @@ -1,5 +1,5 @@ # Add more folders to ship with the application, here -folder_01.source = qml +folder_01.source = qml/googlemaps folder_01.target = qml DEPLOYMENTFOLDERS = folder_01 @@ -35,5 +35,5 @@ symbian:TARGET.UID3 = 0xEF02570C 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/modelviews/webview/googlemaps/qml/webview.qmlproject b/examples/declarative/modelviews/webview/googlemaps/googlemaps.qmlproject index d4909f8..23a41e5 100644 --- a/examples/declarative/modelviews/webview/googlemaps/qml/webview.qmlproject +++ b/examples/declarative/modelviews/webview/googlemaps/googlemaps.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/googlemaps" } JavaScriptFiles { - directory: "." + directory: "qml/googlemaps" } ImageFiles { - directory: "." + directory: "qml/googlemaps" } /* List of plugin directories passed to QML runtime */ // importPaths: [ " ../exampleplugin " ] diff --git a/examples/declarative/modelviews/webview/googlemaps/main.cpp b/examples/declarative/modelviews/webview/googlemaps/main.cpp index 9e4da07..0aaf017 100644 --- a/examples/declarative/modelviews/webview/googlemaps/main.cpp +++ b/examples/declarative/modelviews/webview/googlemaps/main.cpp @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) QmlApplicationViewer viewer; viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); - viewer.setMainQmlFile(QLatin1String("qml/qml/googlemaps.qml")); + viewer.setMainQmlFile(QLatin1String("qml/googlemaps/googlemaps.qml")); viewer.showExpanded(); return app.exec(); diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/alerts.html b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/alerts.html index 82caddf..82caddf 100644 --- a/examples/declarative/modelviews/webview/googlemaps/qml/alerts.html +++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/alerts.html diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/alerts.qml b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/alerts.qml index 4aa4a3b..4aa4a3b 100644 --- a/examples/declarative/modelviews/webview/googlemaps/qml/alerts.qml +++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/alerts.qml diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/autosize.qml b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/autosize.qml index 7e10403..7e10403 100644 --- a/examples/declarative/modelviews/webview/googlemaps/qml/autosize.qml +++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/autosize.qml diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/Mapping/Map.qml index 9a86579..9a86579 100644 --- a/examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/Map.qml +++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/Mapping/Map.qml diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/map.html b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/Mapping/map.html index a98da54..a98da54 100644 --- a/examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/map.html +++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/Mapping/map.html diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/content/pics/cancel.png b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/pics/cancel.png Binary files differindex ecc9533..ecc9533 100644 --- a/examples/declarative/modelviews/webview/googlemaps/qml/content/pics/cancel.png +++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/pics/cancel.png diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/content/pics/ok.png b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/pics/ok.png Binary files differindex 5795f04..5795f04 100644 --- a/examples/declarative/modelviews/webview/googlemaps/qml/content/pics/ok.png +++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/pics/ok.png diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps.qml b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/googlemaps.qml index aed0ddd..aed0ddd 100644 --- a/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps.qml +++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/googlemaps.qml diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/inlinehtml.qml b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/inlinehtml.qml index afc1fa9..afc1fa9 100644 --- a/examples/declarative/modelviews/webview/googlemaps/qml/inlinehtml.qml +++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/inlinehtml.qml diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/newwindows.html b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/newwindows.html index f169599..f169599 100644 --- a/examples/declarative/modelviews/webview/googlemaps/qml/newwindows.html +++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/newwindows.html diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/newwindows.qml b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/newwindows.qml index 52f7a0b..52f7a0b 100644 --- a/examples/declarative/modelviews/webview/googlemaps/qml/newwindows.qml +++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/newwindows.qml diff --git a/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index 411a04c..0000000 --- a/examples/declarative/modelviews/webview/googlemaps/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/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index f5b24b0..0000000 --- a/examples/declarative/modelviews/webview/googlemaps/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/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.pri deleted file mode 100644 index 1c0c7ed..0000000 --- a/examples/declarative/modelviews/webview/googlemaps/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) -} diff --git a/examples/declarative/modelviews/webview/inlinehtml.qml b/examples/declarative/modelviews/webview/inlinehtml.qml deleted file mode 100644 index 1b0c15e..0000000 --- a/examples/declarative/modelviews/webview/inlinehtml.qml +++ /dev/null @@ -1,55 +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 examples 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$ -** -****************************************************************************/ - -import QtQuick 1.0 -import QtWebKit 1.0 - -// Inline HTML with loose formatting can be -// set on the html property. -WebView { - html:"\ - <body> - <table border=1> - <tr><th><th>One<th>Two<th>Three - <tr><th>1<td>X<td>1<td>X - <tr><th>2<td>0<td>X<td>0 - <tr><th>3<td>X<td>1<td>X - </table>" -} diff --git a/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pro b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pro index 86cdd1e..7accabe 100644 --- a/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pro +++ b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pro @@ -1,5 +1,5 @@ # Add more folders to ship with the application, here -folder_01.source = qml +folder_01.source = qml/inlinehtml folder_01.target = qml DEPLOYMENTFOLDERS = folder_01 @@ -35,5 +35,5 @@ symbian:TARGET.UID3 = 0xEF18EEF4 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/modelviews/webview/inlinehtml/qml/webview.qmlproject b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.qmlproject index d4909f8..046124b 100644 --- a/examples/declarative/modelviews/webview/inlinehtml/qml/webview.qmlproject +++ b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.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/inlinehtml" } JavaScriptFiles { - directory: "." + directory: "qml/inlinehtml" } ImageFiles { - directory: "." + directory: "qml/inlinehtml" } /* List of plugin directories passed to QML runtime */ // importPaths: [ " ../exampleplugin " ] diff --git a/examples/declarative/modelviews/webview/inlinehtml/main.cpp b/examples/declarative/modelviews/webview/inlinehtml/main.cpp index bb57ec6..cb324e6 100644 --- a/examples/declarative/modelviews/webview/inlinehtml/main.cpp +++ b/examples/declarative/modelviews/webview/inlinehtml/main.cpp @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) QmlApplicationViewer viewer; viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); - viewer.setMainQmlFile(QLatin1String("qml/qml/inlinehtml.qml")); + viewer.setMainQmlFile(QLatin1String("qml/inlinehtml/inlinehtml.qml")); viewer.showExpanded(); return app.exec(); diff --git a/examples/declarative/modelviews/webview/autosize/qml/alerts.html b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/alerts.html index 82caddf..82caddf 100644 --- a/examples/declarative/modelviews/webview/autosize/qml/alerts.html +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/alerts.html diff --git a/examples/declarative/modelviews/webview/autosize/qml/alerts.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/alerts.qml index 4aa4a3b..4aa4a3b 100644 --- a/examples/declarative/modelviews/webview/autosize/qml/alerts.qml +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/alerts.qml diff --git a/examples/declarative/modelviews/webview/autosize/qml/autosize.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/autosize.qml index 7e10403..7e10403 100644 --- a/examples/declarative/modelviews/webview/autosize/qml/autosize.qml +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/autosize.qml diff --git a/examples/declarative/modelviews/webview/autosize/qml/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/content/Mapping/Map.qml index 9a86579..9a86579 100644 --- a/examples/declarative/modelviews/webview/autosize/qml/content/Mapping/Map.qml +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/content/Mapping/Map.qml diff --git a/examples/declarative/modelviews/webview/autosize/qml/content/Mapping/map.html b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/content/Mapping/map.html index a98da54..a98da54 100644 --- a/examples/declarative/modelviews/webview/autosize/qml/content/Mapping/map.html +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/content/Mapping/map.html diff --git a/examples/declarative/modelviews/webview/autosize/qml/content/pics/cancel.png b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/content/pics/cancel.png Binary files differindex ecc9533..ecc9533 100644 --- a/examples/declarative/modelviews/webview/autosize/qml/content/pics/cancel.png +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/content/pics/cancel.png diff --git a/examples/declarative/modelviews/webview/autosize/qml/content/pics/ok.png b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/content/pics/ok.png Binary files differindex 5795f04..5795f04 100644 --- a/examples/declarative/modelviews/webview/autosize/qml/content/pics/ok.png +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/content/pics/ok.png diff --git a/examples/declarative/modelviews/webview/autosize/qml/googlemaps.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/googlemaps.qml index aed0ddd..aed0ddd 100644 --- a/examples/declarative/modelviews/webview/autosize/qml/googlemaps.qml +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/googlemaps.qml diff --git a/examples/declarative/modelviews/webview/autosize/qml/inlinehtml.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/inlinehtml.qml index afc1fa9..afc1fa9 100644 --- a/examples/declarative/modelviews/webview/autosize/qml/inlinehtml.qml +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/inlinehtml.qml diff --git a/examples/declarative/modelviews/webview/autosize/qml/newwindows.html b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/newwindows.html index f169599..f169599 100644 --- a/examples/declarative/modelviews/webview/autosize/qml/newwindows.html +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/newwindows.html diff --git a/examples/declarative/modelviews/webview/autosize/qml/newwindows.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/newwindows.qml index 52f7a0b..52f7a0b 100644 --- a/examples/declarative/modelviews/webview/autosize/qml/newwindows.qml +++ b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/newwindows.qml diff --git a/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index 411a04c..0000000 --- a/examples/declarative/modelviews/webview/inlinehtml/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/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index f5b24b0..0000000 --- a/examples/declarative/modelviews/webview/inlinehtml/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/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.pri deleted file mode 100644 index 1c0c7ed..0000000 --- a/examples/declarative/modelviews/webview/inlinehtml/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) -} diff --git a/examples/declarative/modelviews/webview/newwindows.qml b/examples/declarative/modelviews/webview/newwindows.qml deleted file mode 100644 index 07954f4..0000000 --- a/examples/declarative/modelviews/webview/newwindows.qml +++ /dev/null @@ -1,71 +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 examples 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$ -** -****************************************************************************/ - -// Demonstrates opening new WebViews from HTML -// -// Note that to open windows from JavaScript, you will need to -// allow it on WebView with settings.javascriptCanOpenWindows: true - -import QtQuick 1.0 -import QtWebKit 1.0 - -Grid { - columns: 3 - id: pages - height: 300; width: 600 - - Component { - id: webViewPage - Rectangle { - width: webView.width - height: webView.height - border.color: "gray" - - WebView { - id: webView - newWindowComponent: webViewPage - newWindowParent: pages - url: "newwindows.html" - } - } - } - - Loader { sourceComponent: webViewPage } -} diff --git a/examples/declarative/modelviews/webview/newwindows/main.cpp b/examples/declarative/modelviews/webview/newwindows/main.cpp index 6be8235..92a6e94 100644 --- a/examples/declarative/modelviews/webview/newwindows/main.cpp +++ b/examples/declarative/modelviews/webview/newwindows/main.cpp @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) QmlApplicationViewer viewer; viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); - viewer.setMainQmlFile(QLatin1String("qml/qml/newwindows.qml")); + viewer.setMainQmlFile(QLatin1String("qml/newwindows/newwindows.qml")); viewer.showExpanded(); return app.exec(); diff --git a/examples/declarative/modelviews/webview/newwindows/newwindows.pro b/examples/declarative/modelviews/webview/newwindows/newwindows.pro index 0ade74b..d153561 100644 --- a/examples/declarative/modelviews/webview/newwindows/newwindows.pro +++ b/examples/declarative/modelviews/webview/newwindows/newwindows.pro @@ -1,5 +1,5 @@ # Add more folders to ship with the application, here -folder_01.source = qml +folder_01.source = qml/newwindows folder_01.target = qml DEPLOYMENTFOLDERS = folder_01 @@ -35,5 +35,5 @@ symbian:TARGET.UID3 = 0xEE16E439 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/modelviews/webview/newwindows/newwindows.qmlproject b/examples/declarative/modelviews/webview/newwindows/newwindows.qmlproject new file mode 100644 index 0000000..dd58cbf --- /dev/null +++ b/examples/declarative/modelviews/webview/newwindows/newwindows.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "qml/newwindows" + } + JavaScriptFiles { + directory: "qml/newwindows" + } + ImageFiles { + directory: "qml/newwindows" + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/modelviews/webview/alerts/qml/alerts.html b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/alerts.html index 82caddf..82caddf 100644 --- a/examples/declarative/modelviews/webview/alerts/qml/alerts.html +++ b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/alerts.html diff --git a/examples/declarative/modelviews/webview/alerts/qml/alerts.qml b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/alerts.qml index 4aa4a3b..4aa4a3b 100644 --- a/examples/declarative/modelviews/webview/alerts/qml/alerts.qml +++ b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/alerts.qml diff --git a/examples/declarative/modelviews/webview/alerts/qml/autosize.qml b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/autosize.qml index 7e10403..7e10403 100644 --- a/examples/declarative/modelviews/webview/alerts/qml/autosize.qml +++ b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/autosize.qml diff --git a/examples/declarative/modelviews/webview/alerts/qml/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/content/Mapping/Map.qml index 9a86579..9a86579 100644 --- a/examples/declarative/modelviews/webview/alerts/qml/content/Mapping/Map.qml +++ b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/content/Mapping/Map.qml diff --git a/examples/declarative/modelviews/webview/alerts/qml/content/Mapping/map.html b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/content/Mapping/map.html index a98da54..a98da54 100644 --- a/examples/declarative/modelviews/webview/alerts/qml/content/Mapping/map.html +++ b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/content/Mapping/map.html diff --git a/examples/declarative/modelviews/webview/alerts/qml/content/pics/cancel.png b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/content/pics/cancel.png Binary files differindex ecc9533..ecc9533 100644 --- a/examples/declarative/modelviews/webview/alerts/qml/content/pics/cancel.png +++ b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/content/pics/cancel.png diff --git a/examples/declarative/modelviews/webview/alerts/qml/content/pics/ok.png b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/content/pics/ok.png Binary files differindex 5795f04..5795f04 100644 --- a/examples/declarative/modelviews/webview/alerts/qml/content/pics/ok.png +++ b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/content/pics/ok.png diff --git a/examples/declarative/modelviews/webview/alerts/qml/googlemaps.qml b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/googlemaps.qml index aed0ddd..aed0ddd 100644 --- a/examples/declarative/modelviews/webview/alerts/qml/googlemaps.qml +++ b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/googlemaps.qml diff --git a/examples/declarative/modelviews/webview/alerts/qml/inlinehtml.qml b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/inlinehtml.qml index afc1fa9..afc1fa9 100644 --- a/examples/declarative/modelviews/webview/alerts/qml/inlinehtml.qml +++ b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/inlinehtml.qml diff --git a/examples/declarative/modelviews/webview/alerts/qml/newwindows.html b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/newwindows.html index f169599..f169599 100644 --- a/examples/declarative/modelviews/webview/alerts/qml/newwindows.html +++ b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/newwindows.html diff --git a/examples/declarative/modelviews/webview/alerts/qml/newwindows.qml b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/newwindows.qml index 52f7a0b..52f7a0b 100644 --- a/examples/declarative/modelviews/webview/alerts/qml/newwindows.qml +++ b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/newwindows.qml diff --git a/examples/declarative/modelviews/webview/newwindows/qml/webview.qmlproject b/examples/declarative/modelviews/webview/newwindows/qml/webview.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/modelviews/webview/newwindows/qml/webview.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/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index 411a04c..0000000 --- a/examples/declarative/modelviews/webview/newwindows/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/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index f5b24b0..0000000 --- a/examples/declarative/modelviews/webview/newwindows/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/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.pri deleted file mode 100644 index 1c0c7ed..0000000 --- a/examples/declarative/modelviews/webview/newwindows/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) -} diff --git a/examples/declarative/modelviews/webview/webview.qmlproject b/examples/declarative/modelviews/webview/webview.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/modelviews/webview/webview.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 " ] -} |