summaryrefslogtreecommitdiff
path: root/share/qtcreator/templates/qtquick/qtquick_1_1
diff options
context:
space:
mode:
Diffstat (limited to 'share/qtcreator/templates/qtquick/qtquick_1_1')
-rw-r--r--share/qtcreator/templates/qtquick/qtquick_1_1/app.pro2
-rw-r--r--share/qtcreator/templates/qtquick/qtquick_1_1/qtquick1applicationviewer/qtquick1applicationviewer.cpp118
-rw-r--r--share/qtcreator/templates/qtquick/qtquick_1_1/qtquick1applicationviewer/qtquick1applicationviewer.h43
-rw-r--r--share/qtcreator/templates/qtquick/qtquick_1_1/qtquick1applicationviewer/qtquick1applicationviewer.pri11
-rw-r--r--share/qtcreator/templates/qtquick/qtquick_1_1/template.xml2
5 files changed, 2 insertions, 174 deletions
diff --git a/share/qtcreator/templates/qtquick/qtquick_1_1/app.pro b/share/qtcreator/templates/qtquick/qtquick_1_1/app.pro
index 0fd73e63dd..1c990093fb 100644
--- a/share/qtcreator/templates/qtquick/qtquick_1_1/app.pro
+++ b/share/qtcreator/templates/qtquick/qtquick_1_1/app.pro
@@ -16,7 +16,7 @@ SOURCES += main.cpp
# target.path =
# Please do not modify the following two lines. Required for deployment.
-include(qtquick1applicationviewer/qtquick1applicationviewer.pri)
+include(../../shared/qtquickapplicationviewer/qtquick1applicationviewer/qtquick1applicationviewer.pri)
# REMOVE_NEXT_LINE (wizard will remove the include and append deployment.pri to qtquick1applicationviewer.pri, instead) #
include(../../shared/deployment.pri)
qtcAddDeployment()
diff --git a/share/qtcreator/templates/qtquick/qtquick_1_1/qtquick1applicationviewer/qtquick1applicationviewer.cpp b/share/qtcreator/templates/qtquick/qtquick_1_1/qtquick1applicationviewer/qtquick1applicationviewer.cpp
deleted file mode 100644
index 0b7ffe85da..0000000000
--- a/share/qtcreator/templates/qtquick/qtquick_1_1/qtquick1applicationviewer/qtquick1applicationviewer.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- This file was generated by the Qt Quick 1 Application wizard of Qt Creator.
- QtQuick1ApplicationViewer is a convenience class containing mobile device
- specific code such as screen orientation handling. Also QML paths 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 "qtquick1applicationviewer.h"
-
-#include <QDir>
-#include <QFileInfo>
-#include <QApplication>
-#include <QDeclarativeComponent>
-#include <QDeclarativeEngine>
-#include <QDeclarativeContext>
-
-#include <qplatformdefs.h> // MEEGO_EDITION_HARMATTAN
-
-class QtQuick1ApplicationViewerPrivate
-{
- QString mainQmlFile;
- friend class QtQuick1ApplicationViewer;
- static QString adjustPath(const QString &path);
-};
-
-QString QtQuick1ApplicationViewerPrivate::adjustPath(const QString &path)
-{
-#if defined(Q_OS_IOS)
- if (!QDir::isAbsolutePath(path))
- return QString::fromLatin1("%1/%2")
- .arg(QCoreApplication::applicationDirPath(), path);
-#elif defined(Q_OS_MAC)
- if (!QDir::isAbsolutePath(path))
- return QString::fromLatin1("%1/../Resources/%2")
- .arg(QCoreApplication::applicationDirPath(), path);
-#elif defined(Q_OS_BLACKBERRY)
- if (!QDir::isAbsolutePath(path))
- return QString::fromLatin1("app/native/%1").arg(path);
-#elif !defined(Q_OS_ANDROID)
- QString pathInInstallDir =
- QString::fromLatin1("%1/../%2").arg(
- QCoreApplication::applicationDirPath(), path);
- if (QFileInfo(pathInInstallDir).exists())
- return pathInInstallDir;
- pathInInstallDir =
- QString::fromLatin1("%1/%2").arg(
- QCoreApplication::applicationDirPath(), path);
- if (QFileInfo(pathInInstallDir).exists())
- return pathInInstallDir;
-#endif
- return path;
-}
-
-QtQuick1ApplicationViewer::QtQuick1ApplicationViewer(QWidget *parent)
- : QDeclarativeView(parent)
- , d(new QtQuick1ApplicationViewerPrivate())
-{
- connect(engine(), SIGNAL(quit()), SLOT(close()));
- setResizeMode(QDeclarativeView::SizeRootObjectToView);
-}
-
-QtQuick1ApplicationViewer::~QtQuick1ApplicationViewer()
-{
- delete d;
-}
-
-QtQuick1ApplicationViewer *QtQuick1ApplicationViewer::create()
-{
- return new QtQuick1ApplicationViewer();
-}
-
-void QtQuick1ApplicationViewer::setMainQmlFile(const QString &file)
-{
- d->mainQmlFile = QtQuick1ApplicationViewerPrivate::adjustPath(file);
-#ifdef Q_OS_ANDROID
- setSource(QUrl(QLatin1String("assets:/")+d->mainQmlFile));
-#else
- setSource(QUrl::fromLocalFile(d->mainQmlFile));
-#endif
-}
-
-void QtQuick1ApplicationViewer::addImportPath(const QString &path)
-{
- engine()->addImportPath(QtQuick1ApplicationViewerPrivate::adjustPath(path));
-}
-
-void QtQuick1ApplicationViewer::setOrientation(ScreenOrientation orientation)
-{
-#if QT_VERSION < 0x050000
- Qt::WidgetAttribute attribute;
- switch (orientation) {
- case ScreenOrientationLockPortrait:
- attribute = Qt::WA_LockPortraitOrientation;
- break;
- case ScreenOrientationLockLandscape:
- attribute = Qt::WA_LockLandscapeOrientation;
- break;
- default:
- case ScreenOrientationAuto:
- attribute = Qt::WA_AutoOrientation;
- break;
- };
- setAttribute(attribute, true);
-#else // QT_VERSION < 0x050000
- Q_UNUSED(orientation)
-#endif // QT_VERSION < 0x050000
-}
-
-void QtQuick1ApplicationViewer::showExpanded()
-{
-#if defined(Q_WS_SIMULATOR) || defined(Q_OS_QNX)
- showFullScreen();
-#else
- show();
-#endif
-}
diff --git a/share/qtcreator/templates/qtquick/qtquick_1_1/qtquick1applicationviewer/qtquick1applicationviewer.h b/share/qtcreator/templates/qtquick/qtquick_1_1/qtquick1applicationviewer/qtquick1applicationviewer.h
deleted file mode 100644
index b9dc3a9fee..0000000000
--- a/share/qtcreator/templates/qtquick/qtquick_1_1/qtquick1applicationviewer/qtquick1applicationviewer.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- This file was generated by the Qt Quick 1 Application wizard of Qt Creator.
- QtQuick1ApplicationViewer is a convenience class containing mobile device
- specific code such as screen orientation handling. Also QML paths 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 QTQUICK1APPLICATIONVIEWER_H
-#define QTQUICK1APPLICATIONVIEWER_H
-
-#include <QDeclarativeView>
-
-class QtQuick1ApplicationViewer : public QDeclarativeView
-{
- Q_OBJECT
-
-public:
- enum ScreenOrientation {
- ScreenOrientationLockPortrait,
- ScreenOrientationLockLandscape,
- ScreenOrientationAuto
- };
-
- explicit QtQuick1ApplicationViewer(QWidget *parent = 0);
- virtual ~QtQuick1ApplicationViewer();
-
- static QtQuick1ApplicationViewer *create();
-
- void setMainQmlFile(const QString &file);
- void addImportPath(const QString &path);
-
- // Note that this will only have an effect on Fremantle.
- void setOrientation(ScreenOrientation orientation);
-
- void showExpanded();
-
-private:
- class QtQuick1ApplicationViewerPrivate *d;
-};
-
-#endif // QTQUICK1APPLICATIONVIEWER_H
diff --git a/share/qtcreator/templates/qtquick/qtquick_1_1/qtquick1applicationviewer/qtquick1applicationviewer.pri b/share/qtcreator/templates/qtquick/qtquick_1_1/qtquick1applicationviewer/qtquick1applicationviewer.pri
deleted file mode 100644
index 030edc1d01..0000000000
--- a/share/qtcreator/templates/qtquick/qtquick_1_1/qtquick1applicationviewer/qtquick1applicationviewer.pri
+++ /dev/null
@@ -1,11 +0,0 @@
-# This file was generated by the Qt Quick 1 Application wizard of Qt Creator.
-# The code below adds the QtQuick1ApplicationViewer to the project.
-#
-# 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/qtquick1applicationviewer.cpp
-HEADERS += $$PWD/qtquick1applicationviewer.h
-INCLUDEPATH += $$PWD
diff --git a/share/qtcreator/templates/qtquick/qtquick_1_1/template.xml b/share/qtcreator/templates/qtquick/qtquick_1_1/template.xml
index 3a39b42d35..e9ab8b2956 100644
--- a/share/qtcreator/templates/qtquick/qtquick_1_1/template.xml
+++ b/share/qtcreator/templates/qtquick/qtquick_1_1/template.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<template openeditor="main.qml" priority="C"
+<template openeditor="main.qml" priority="F"
featuresRequired="QtSupport.Wizards.FeatureQtQuick, QtSupport.Wizards.FeatureQtQuick.1.1"
viewerdir="qtquick1applicationviewer"
viewerclassname="QtQuick1ApplicationViewer"