diff options
author | artoka <arto.katajasalo@digia.com> | 2011-11-17 14:49:41 (GMT) |
---|---|---|
committer | Casper van Donderen <casper.vandonderen@nokia.com> | 2011-11-17 14:58:09 (GMT) |
commit | 3a750ac1b575efb2da50557483d6a1c3e1813c9d (patch) | |
tree | dd517eefdc0b061a1d7c234a24a6164296b02ab9 /examples/declarative/cppextensions | |
parent | e6fa91b169ad4cfbc07f5169765cc7cdf8130c54 (diff) | |
download | Qt-3a750ac1b575efb2da50557483d6a1c3e1813c9d.zip Qt-3a750ac1b575efb2da50557483d6a1c3e1813c9d.tar.gz Qt-3a750ac1b575efb2da50557483d6a1c3e1813c9d.tar.bz2 |
cppextensions/networkaccessmanagerfactory modifications
Modified the example to use centralized qmlapplicationviewer,
removed duplicated 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/cppextensions')
-rw-r--r-- | examples/declarative/cppextensions/networkaccessmanagerfactory/main.cpp | 16 | ||||
-rw-r--r-- | examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.pro | 46 | ||||
-rw-r--r-- | examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qmlproject | 6 | ||||
-rw-r--r-- | examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qrc | 8 | ||||
-rw-r--r-- | examples/declarative/cppextensions/networkaccessmanagerfactory/qml/networkaccessmanagerfactory/view.qml (renamed from examples/declarative/cppextensions/networkaccessmanagerfactory/view.qml) | 0 |
5 files changed, 52 insertions, 24 deletions
diff --git a/examples/declarative/cppextensions/networkaccessmanagerfactory/main.cpp b/examples/declarative/cppextensions/networkaccessmanagerfactory/main.cpp index 665feac..3a73068 100644 --- a/examples/declarative/cppextensions/networkaccessmanagerfactory/main.cpp +++ b/examples/declarative/cppextensions/networkaccessmanagerfactory/main.cpp @@ -41,11 +41,9 @@ #include <QApplication> #include <QNetworkAccessManager> #include <QNetworkProxy> - #include <QDeclarativeEngine> #include <QDeclarativeNetworkAccessManagerFactory> -#include <QDeclarativeView> - +#include "qmlapplicationviewer.h" /* This example illustrates using a QDeclarativeNetworkAccessManagerFactory to @@ -78,9 +76,10 @@ QNetworkAccessManager *MyNetworkAccessManagerFactory::create(QObject *parent) int main(int argc, char ** argv) { - QUrl source("qrc:view.qml"); + QUrl source("qml/networkaccessmanagerfactory/view.qml"); QApplication app(argc, argv); + QmlApplicationViewer viewer; for (int i = 1; i < argc; ++i) { QString arg(argv[i]); @@ -97,11 +96,10 @@ int main(int argc, char ** argv) } } - QDeclarativeView view; - view.engine()->setNetworkAccessManagerFactory(new MyNetworkAccessManagerFactory); - - view.setSource(source); - view.show(); + viewer.engine()->setNetworkAccessManagerFactory(new MyNetworkAccessManagerFactory); + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); + viewer.setMainQmlFile(source.toString()); + viewer.showExpanded(); return app.exec(); } diff --git a/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.pro b/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.pro index 74d8db3..66ce4b1 100644 --- a/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.pro +++ b/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.pro @@ -1,9 +1,39 @@ -TEMPLATE = app -TARGET = networkaccessmanagerfactory -DEPENDPATH += . -INCLUDEPATH += . -QT += declarative network - -# Input -SOURCES += main.cpp +# Add more folders to ship with the application, here +folder_01.source = qml/networkaccessmanagerfactory +folder_01.target = qml +DEPLOYMENTFOLDERS = folder_01 + +# Additional import path used to resolve QML modules in Creator's code model +QML_IMPORT_PATH = + +symbian:TARGET.UID3 = 0xE1CB8EBB + +# Smart Installer package's UID +# This UID is from the protected range and therefore the package will +# fail to install if self-signed. By default qmake uses the unprotected +# range value if unprotected UID is defined for the application and +# 0x2002CCCF value if protected UID is given to the application +#symbian:DEPLOYMENT.installer_header = 0x2002CCCF + +# Allow network access on Symbian +symbian:TARGET.CAPABILITY += NetworkServices + +# If your application uses the Qt Mobility libraries, uncomment the following +# lines and add the respective components to the MOBILITY variable. +# CONFIG += mobility +# MOBILITY += + +# Speed up launching on MeeGo/Harmattan when using applauncherd daemon +# CONFIG += qdeclarative-boostable + +# Add dependency to Symbian components +# CONFIG += qt-components +QT += network + +# The .cpp file which was generated for your project. Feel free to hack it. +SOURCES += main.cpp RESOURCES += networkaccessmanagerfactory.qrc + +# Please do not modify the following two lines. Required for deployment. +include(../../../tools/qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qmlproject b/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qmlproject index d4909f8..7f870a1 100644 --- a/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qmlproject +++ b/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.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/networkaccessmanagerfactory" } JavaScriptFiles { - directory: "." + directory: "qml/networkaccessmanagerfactory" } ImageFiles { - directory: "." + directory: "qml/networkaccessmanagerfactory" } /* List of plugin directories passed to QML runtime */ // importPaths: [ " ../exampleplugin " ] diff --git a/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qrc b/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qrc index 17e9301..a5341c1 100644 --- a/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qrc +++ b/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qrc @@ -1,5 +1,5 @@ -<!DOCTYPE RCC><RCC version="1.0"> -<qresource> - <file>view.qml</file> -</qresource> +<RCC> + <qresource prefix="/"> + <file>qml/networkaccessmanagerfactory/view.qml</file> + </qresource> </RCC> diff --git a/examples/declarative/cppextensions/networkaccessmanagerfactory/view.qml b/examples/declarative/cppextensions/networkaccessmanagerfactory/qml/networkaccessmanagerfactory/view.qml index e002ef6..e002ef6 100644 --- a/examples/declarative/cppextensions/networkaccessmanagerfactory/view.qml +++ b/examples/declarative/cppextensions/networkaccessmanagerfactory/qml/networkaccessmanagerfactory/view.qml |