summaryrefslogtreecommitdiffstats
path: root/demos/qmlcustomizations
diff options
context:
space:
mode:
Diffstat (limited to 'demos/qmlcustomizations')
-rw-r--r--demos/qmlcustomizations/main.cpp43
-rw-r--r--demos/qmlcustomizations/qml/qmlcustomizations/loader.qml37
-rw-r--r--demos/qmlcustomizations/qml/qmlcustomizations/main.qml101
-rw-r--r--demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.cpp177
-rw-r--r--demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.h46
-rw-r--r--demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.pri13
-rw-r--r--demos/qmlcustomizations/qmlcustomizations.pro9
-rw-r--r--demos/qmlcustomizations/resources.qrc6
8 files changed, 0 insertions, 432 deletions
diff --git a/demos/qmlcustomizations/main.cpp b/demos/qmlcustomizations/main.cpp
deleted file mode 100644
index 79424b95..00000000
--- a/demos/qmlcustomizations/main.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc
-** All rights reserved.
-** For any questions to Digia, please use contact form at http://qt.digia.com
-**
-** This file is part of the Qt Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
-**
-** If you have questions regarding the use of this file, please use
-** contact form at http://qt.digia.com
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include <QtDeclarative/QDeclarativeEngine>
-#include <QDir>
-#include "qmlapplicationviewer.h"
-
-Q_DECL_EXPORT int main(int argc, char *argv[])
-{
- QScopedPointer<QApplication> app(createApplication(argc, argv));
- QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create());
-#ifdef Q_OS_ANDROID
- viewer->addImportPath(QString::fromLatin1("assets:/imports"));
- viewer->engine()->addPluginPath(QString::fromLatin1("%1/../%2").arg(QDir::homePath(), QString::fromLatin1("lib")));
-#else
- viewer->addImportPath(QString::fromLatin1("%1/%2").arg(QCoreApplication::applicationDirPath(), QString::fromLatin1("imports")));
-#endif
-
- // // viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
- viewer->setSource(QUrl("qrc:/qml/qmlcustomizations/loader.qml"));
- viewer->setRenderHint(QPainter::Antialiasing, true);
- viewer->showExpanded();
-
- return app->exec();
-}
diff --git a/demos/qmlcustomizations/qml/qmlcustomizations/loader.qml b/demos/qmlcustomizations/qml/qmlcustomizations/loader.qml
deleted file mode 100644
index c3eea330..00000000
--- a/demos/qmlcustomizations/qml/qmlcustomizations/loader.qml
+++ /dev/null
@@ -1,37 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc
-** All rights reserved.
-** For any questions to Digia, please use contact form at http://qt.digia.com
-**
-** This file is part of the Qt Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
-**
-** If you have questions regarding the use of this file, please use
-** contact form at http://qt.digia.com
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-Item {
- id: container
- width: 400
- height: 300
- Component.onCompleted: {
- var co = Qt.createComponent("main.qml")
- if (co.status == Component.Ready) {
- var o = co.createObject(container)
- } else {
- console.log(co.errorString())
- console.log("QtCommercial.Chart 1.1 not available")
- console.log("Please use correct QML_IMPORT_PATH export")
- }
- }
-}
diff --git a/demos/qmlcustomizations/qml/qmlcustomizations/main.qml b/demos/qmlcustomizations/qml/qmlcustomizations/main.qml
deleted file mode 100644
index f338d692..00000000
--- a/demos/qmlcustomizations/qml/qmlcustomizations/main.qml
+++ /dev/null
@@ -1,101 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc
-** All rights reserved.
-** For any questions to Digia, please use contact form at http://qt.digia.com
-**
-** This file is part of the Qt Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
-**
-** If you have questions regarding the use of this file, please use
-** contact form at http://qt.digia.com
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import QtCommercial.Chart 1.1
-
-Rectangle {
- width: parent.width
- height: parent.height
- property int __activeIndex: 1
- property real __intervalCoefficient: 0
-
- //![1]
- ChartView {
- id: chartView
- anchors.fill: parent
- title: "Wheel of fortune"
- legend.visible: false
-
- PieSeries {
- id: wheelOfFortune
- horizontalPosition: 0.3
- }
-
- SplineSeries {
- id: splineSeries
- }
-
- ScatterSeries {
- id: scatterSeries
- }
- }
- //![1]
-
- //![2]
- Component.onCompleted: {
- __intervalCoefficient = Math.random() + 0.1;
-
- for (var i = 0; i < 20; i++)
- wheelOfFortune.append("", 1);
-
- var interval = 1;
- for (var j = 0; interval < 800; j++) {
- interval = __intervalCoefficient * j * j;
- splineSeries.append(j, interval);
- }
- chartView.axisX(scatterSeries).max = j;
- chartView.axisY(scatterSeries).max = 1000;
- }
- //![2]
-
- Timer {
- triggeredOnStart: true
- running: true
- repeat: true
- interval: 100
- onTriggered: {
- var index = __activeIndex % wheelOfFortune.count;
- if (interval < 700) {
- //![3]
- wheelOfFortune.at(index).exploded = false;
- __activeIndex++;
- index = __activeIndex % wheelOfFortune.count;
- wheelOfFortune.at(index).exploded = true;
- //![3]
- interval = splineSeries.at(__activeIndex).y;
- //![4]
- scatterSeries.clear();
- scatterSeries.append(__activeIndex, interval);
- scatterSeries.color = Qt.tint(scatterSeries.color, "#05FF0000");
- scatterSeries.markerSize += 0.5;
- //![4]
- } else {
- //![5]
- // Switch the colors of the slice and the border
- wheelOfFortune.at(index).borderWidth = 2;
- var borderColor = wheelOfFortune.at(index).borderColor;
- wheelOfFortune.at(index).borderColor = wheelOfFortune.at(index).color;
- wheelOfFortune.at(index).color = borderColor;
- //![5]
- }
- }
- }
-}
diff --git a/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.cpp b/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.cpp
deleted file mode 100644
index cb227056..00000000
--- a/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-// checksum 0xaa72 version 0x90018
-/*
- 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 <QDir>
-#include <QFileInfo>
-#include <QApplication>
-#include <QDeclarativeComponent>
-#include <QDeclarativeEngine>
-#include <QDeclarativeContext>
-
-#include <qplatformdefs.h> // MEEGO_EDITION_HARMATTAN
-
-#ifdef HARMATTAN_BOOSTER
-#include <MDeclarativeCache>
-#endif
-
-#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
-
-#include <qt_private/qdeclarativedebughelper_p.h>
-
-#if !defined(NO_JSDEBUGGER)
-#include <jsdebuggeragent.h>
-#endif
-#if !defined(NO_QMLOBSERVER)
-#include <qdeclarativeviewobserver.h>
-#endif
-
-// 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_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;
-}
-
-QmlApplicationViewer::QmlApplicationViewer(QWidget *parent)
- : QDeclarativeView(parent)
- , d(new QmlApplicationViewerPrivate())
-{
- connect(engine(), SIGNAL(quit()), SLOT(close()));
- setResizeMode(QDeclarativeView::SizeRootObjectToView);
-
- // Qt versions prior to 4.8.0 don't have QML/JS debugging services built in
-#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
-#if !defined(NO_JSDEBUGGER)
- new QmlJSDebugger::JSDebuggerAgent(engine());
-#endif
-#if !defined(NO_QMLOBSERVER)
- new QmlJSDebugger::QDeclarativeViewObserver(this, this);
-#endif
-#endif
-}
-
-QmlApplicationViewer::~QmlApplicationViewer()
-{
- delete d;
-}
-
-QmlApplicationViewer *QmlApplicationViewer::create()
-{
- return new QmlApplicationViewer();
-}
-
-void QmlApplicationViewer::setMainQmlFile(const QString &file)
-{
- d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
-#ifdef Q_OS_ANDROID
- setSource(QUrl(QLatin1String("assets:/")+d->mainQmlFile));
-#else
- setSource(QUrl::fromLocalFile(d->mainQmlFile));
-#endif
-}
-
-void QmlApplicationViewer::addImportPath(const QString &path)
-{
- engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
-}
-
-void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
-{
-#if QT_VERSION < 0x050000
- Qt::WidgetAttribute attribute;
- switch (orientation) {
-#if QT_VERSION < 0x040702
- // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes
- case ScreenOrientationLockPortrait:
- attribute = static_cast<Qt::WidgetAttribute>(128);
- break;
- case ScreenOrientationLockLandscape:
- attribute = static_cast<Qt::WidgetAttribute>(129);
- break;
- default:
- case ScreenOrientationAuto:
- attribute = static_cast<Qt::WidgetAttribute>(130);
- break;
-#else // QT_VERSION < 0x040702
- case ScreenOrientationLockPortrait:
- attribute = Qt::WA_LockPortraitOrientation;
- break;
- case ScreenOrientationLockLandscape:
- attribute = Qt::WA_LockLandscapeOrientation;
- break;
- default:
- case ScreenOrientationAuto:
- attribute = Qt::WA_AutoOrientation;
- break;
-#endif // QT_VERSION < 0x040702
- };
- setAttribute(attribute, true);
-#else // QT_VERSION < 0x050000
- Q_UNUSED(orientation)
-#endif // QT_VERSION < 0x050000
-}
-
-void QmlApplicationViewer::showExpanded()
-{
-#if defined(MEEGO_EDITION_HARMATTAN) || defined(Q_WS_SIMULATOR)
- showFullScreen();
-#elif defined(Q_WS_MAEMO_5) || defined(Q_OS_QNX)
- showMaximized();
-#else
- show();
-#endif
-}
-
-QApplication *createApplication(int &argc, char **argv)
-{
-#ifdef HARMATTAN_BOOSTER
- return MDeclarativeCache::qApplication(argc, argv);
-#else
- return new QApplication(argc, argv);
-#endif
-}
diff --git a/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.h b/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.h
deleted file mode 100644
index adcb232f..00000000
--- a/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.h
+++ /dev/null
@@ -1,46 +0,0 @@
-// checksum 0xc67a version 0x90018
-/*
- 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 <QDeclarativeView>
-
-class QmlApplicationViewer : public QDeclarativeView
-{
- Q_OBJECT
-
-public:
- enum ScreenOrientation {
- ScreenOrientationLockPortrait,
- ScreenOrientationLockLandscape,
- ScreenOrientationAuto
- };
-
- explicit QmlApplicationViewer(QWidget *parent = 0);
- virtual ~QmlApplicationViewer();
-
- static QmlApplicationViewer *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 QmlApplicationViewerPrivate *d;
-};
-
-QApplication *createApplication(int &argc, char **argv);
-
-#endif // QMLAPPLICATIONVIEWER_H
diff --git a/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.pri b/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.pri
deleted file mode 100644
index 567c6dc6..00000000
--- a/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.pri
+++ /dev/null
@@ -1,13 +0,0 @@
-QT += declarative
-
-SOURCES += $$PWD/qmlapplicationviewer.cpp
-HEADERS += $$PWD/qmlapplicationviewer.h
-INCLUDEPATH += $$PWD
-
-# Include JS debugger library if QMLJSDEBUGGER_PATH is set
-!isEmpty(QMLJSDEBUGGER_PATH) {
- include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
-} else {
- DEFINES -= QMLJSDEBUGGER
-}
-
diff --git a/demos/qmlcustomizations/qmlcustomizations.pro b/demos/qmlcustomizations/qmlcustomizations.pro
deleted file mode 100644
index f4da8598..00000000
--- a/demos/qmlcustomizations/qmlcustomizations.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-!include( ../demos.pri ) {
- error( "Couldn't find the demos.pri file!" )
-}
-
-RESOURCES += resources.qrc
-SOURCES += main.cpp
-OTHER_FILES += qml/qmlcustomizations/*
-
-include(qmlapplicationviewer/qmlapplicationviewer.pri)
diff --git a/demos/qmlcustomizations/resources.qrc b/demos/qmlcustomizations/resources.qrc
deleted file mode 100644
index d7966f36..00000000
--- a/demos/qmlcustomizations/resources.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>qml/qmlcustomizations/loader.qml</file>
- <file>qml/qmlcustomizations/main.qml</file>
- </qresource>
-</RCC>