diff options
Diffstat (limited to 'demos/qmloscilloscope')
-rw-r--r-- | demos/qmloscilloscope/datasource.cpp | 95 | ||||
-rw-r--r-- | demos/qmloscilloscope/datasource.h | 50 | ||||
-rw-r--r-- | demos/qmloscilloscope/main.cpp | 47 | ||||
-rw-r--r-- | demos/qmloscilloscope/qml/qmloscilloscope/ControlPanel.qml | 86 | ||||
-rw-r--r-- | demos/qmloscilloscope/qml/qmloscilloscope/MultiButton.qml | 54 | ||||
-rw-r--r-- | demos/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml | 116 | ||||
-rw-r--r-- | demos/qmloscilloscope/qml/qmloscilloscope/main.qml | 62 | ||||
-rw-r--r-- | demos/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.cpp | 177 | ||||
-rw-r--r-- | demos/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.h | 46 | ||||
-rw-r--r-- | demos/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.pri | 13 | ||||
-rw-r--r-- | demos/qmloscilloscope/qmloscilloscope.pro | 13 | ||||
-rw-r--r-- | demos/qmloscilloscope/resources.qrc | 8 |
12 files changed, 0 insertions, 767 deletions
diff --git a/demos/qmloscilloscope/datasource.cpp b/demos/qmloscilloscope/datasource.cpp deleted file mode 100644 index 35285778..00000000 --- a/demos/qmloscilloscope/datasource.cpp +++ /dev/null @@ -1,95 +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 "datasource.h" -#include <QXYSeries> -#include <QAreaSeries> -#include <QDeclarativeView> -#include <QDebug> -#include <qmath.h> - -QTCOMMERCIALCHART_USE_NAMESPACE - -Q_DECLARE_METATYPE(QAbstractSeries *) -Q_DECLARE_METATYPE(QAbstractAxis *) - -DataSource::DataSource(QDeclarativeView *appViewer, QObject *parent) : - QObject(parent), - m_appViewer(appViewer), - m_index(-1) -{ - qRegisterMetaType<QAbstractSeries*>(); - qRegisterMetaType<QAbstractAxis*>(); - - generateData(0, 5, 1024); -} - -void DataSource::update(QAbstractSeries *series) -{ - if (series) { - QXYSeries *xySeries = static_cast<QXYSeries *>(series); - m_index++; - if (m_index > m_data.count() - 1) - m_index = 0; - - QList<QPointF> points = m_data.at(m_index); - // Use replace instead of clear + append, it's optimized for performance - xySeries->replace(points); - } -} - -void DataSource::generateData(int type, int rowCount, int colCount) -{ - // Remove previous data - foreach (QList<QPointF> row, m_data) - row.clear(); - m_data.clear(); - - // Append the new data depending on the type - for (int i(0); i < rowCount; i++) { - QList<QPointF> points; - for (int j(0); j < colCount; j++) { - qreal x(0); - qreal y(0); - switch (type) { - case 0: - // data with sin + random component - y = qSin(3.14159265358979 / 50 * j) + 0.5 + (qreal) rand() / (qreal) RAND_MAX; - x = j; - break; - case 1: - // linear data - x = j; - y = (qreal) i / 10; - break; - default: - // unknown, do nothing - break; - } - points.append(QPointF(x, y)); - } - m_data.append(points); - } -} - -void DataSource::setAntialiasing(bool enabled) -{ - m_appViewer->setRenderHint(QPainter::Antialiasing, enabled); -} diff --git a/demos/qmloscilloscope/datasource.h b/demos/qmloscilloscope/datasource.h deleted file mode 100644 index 7e9f476e..00000000 --- a/demos/qmloscilloscope/datasource.h +++ /dev/null @@ -1,50 +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$ -** -****************************************************************************/ - -#ifndef DATASOURCE_H -#define DATASOURCE_H - -#include <QObject> -#include <QAbstractSeries> - -class QDeclarativeView; - -QTCOMMERCIALCHART_USE_NAMESPACE - -class DataSource : public QObject -{ - Q_OBJECT -public: - explicit DataSource(QDeclarativeView *appViewer, QObject *parent = 0); - -signals: - -public slots: - void generateData(int type, int rowCount, int colCount); - void update(QAbstractSeries *series); - void setAntialiasing(bool enabled); - -private: - QDeclarativeView *m_appViewer; - QList<QList<QPointF> > m_data; - int m_index; -}; - -#endif // DATASOURCE_H diff --git a/demos/qmloscilloscope/main.cpp b/demos/qmloscilloscope/main.cpp deleted file mode 100644 index c00f4599..00000000 --- a/demos/qmloscilloscope/main.cpp +++ /dev/null @@ -1,47 +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/QDeclarativeContext> -#include <QtDeclarative/QDeclarativeEngine> -#include <QDir> -#include "qmlapplicationviewer.h" -#include "datasource.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 - - DataSource dataSource(viewer.data()); - viewer->rootContext()->setContextProperty("dataSource", &dataSource); - - // // viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto); - viewer->setSource(QUrl("qrc:/qml/qmloscilloscope/main.qml")); - viewer->showExpanded(); - - return app->exec(); -} diff --git a/demos/qmloscilloscope/qml/qmloscilloscope/ControlPanel.qml b/demos/qmloscilloscope/qml/qmloscilloscope/ControlPanel.qml deleted file mode 100644 index 8c590de6..00000000 --- a/demos/qmloscilloscope/qml/qmloscilloscope/ControlPanel.qml +++ /dev/null @@ -1,86 +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 - -Column { - spacing: 8 - signal animationsEnabled(bool enabled) - signal seriesTypeChanged(string type) - signal refreshRateChanged(variant rate); - signal signalSourceChanged(string source, int signalCount, int sampleCount); - signal antialiasingEnabled(bool enabled) - - Text { - text: "Scope" - font.pointSize: 18 - color: "white" - } - - MultiButton { - text: "Graph: " - items: ["line", "spline", "scatter"] - currentSelection: 0 - onSelectionChanged: seriesTypeChanged(items[currentSelection]); - } - - MultiButton { - id: signalSourceButton - text: "Source: " - items: ["sin", "linear"] - currentSelection: 0 - onSelectionChanged: signalSourceChanged( - selection, - 5, - sampleCountButton.items[sampleCountButton.currentSelection]); - } - - MultiButton { - id: sampleCountButton - text: "Samples: " - items: [6, 128, 1024, 10000] - currentSelection: 2 - onSelectionChanged: signalSourceChanged( - signalSourceButton.items[signalSourceButton.currentSelection], - 5, - selection); - } - - MultiButton { - text: "Refresh rate: " - items: [1, 24, 60, 100] - currentSelection: 2 - onSelectionChanged: refreshRateChanged(items[currentSelection]); - } - - MultiButton { - text: "Animations: " - items: ["OFF", "ON"] - currentSelection: 0 - onSelectionChanged: animationsEnabled(currentSelection == 1); - } - - MultiButton { - text: "Antialias: " - items: ["OFF", "ON"] - currentSelection: 0 - onSelectionChanged: antialiasingEnabled(currentSelection == 1); - } -} diff --git a/demos/qmloscilloscope/qml/qmloscilloscope/MultiButton.qml b/demos/qmloscilloscope/qml/qmloscilloscope/MultiButton.qml deleted file mode 100644 index 74f8577f..00000000 --- a/demos/qmloscilloscope/qml/qmloscilloscope/MultiButton.qml +++ /dev/null @@ -1,54 +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 - -Rectangle { - id: button - width: 115 - height: 31 - gradient: Gradient { - GradientStop { position: mouseArea.pressed ? 1.0 : 0.0; color: "#A09090" } - GradientStop { position: mouseArea.pressed ? 0.0 : 1.0; color: "#505050" } - } - smooth: true - - radius: 7 - property string text: "Option: " - property variant items: ["first"] - property int currentSelection: 0 - signal selectionChanged(variant selection) - - Text { - id: buttonText - anchors.centerIn: parent - color: "#FFFFFF" - text: button.text + button.items[currentSelection] - } - - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: { - currentSelection = (currentSelection + 1) % items.length; - selectionChanged(button.items[currentSelection]); - } - } -} diff --git a/demos/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml b/demos/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml deleted file mode 100644 index f6b249bb..00000000 --- a/demos/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml +++ /dev/null @@ -1,116 +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.2 - -//![1] -ChartView { - id: chartView - animationOptions: ChartView.NoAnimation - theme: ChartView.ChartThemeDark - - ValueAxis { - id: axisY1 - min: -1 - max: 4 - } - - ValueAxis { - id: axisY2 - min: -10 - max: 5 - } - - ValueAxis { - id: axisX - min: 0 - max: 1000 - } - - LineSeries { - id: lineSeries1 - name: "signal 1" - axisX: axisX - axisY: axisY1 - } - LineSeries { - id: lineSeries2 - name: "signal 2" - axisX: axisX - axisYRight: axisY2 - } -// ... -//![1] - - //![2] - Timer { - id: refreshTimer - interval: 1 / 60 * 1000 // 60 Hz - running: true - repeat: true - onTriggered: { - dataSource.update(chartView.series(0)); - dataSource.update(chartView.series(1)); - } - } - //![2] - - //![3] - function changeSeriesType(type) { - chartView.removeAllSeries(); - - // Create two new series of the correct type. Axis x is the same for both of the series, - // but the series have their own y-axes to make it possible to control the y-offset - // of the "signal sources". - if (type == "line") { - chartView.createSeries(ChartView.SeriesTypeLine, "signal 1", axisX, axisY1); - chartView.createSeries(ChartView.SeriesTypeLine, "signal 2", axisX, axisY2); - } else if (type == "spline") { - chartView.createSeries(ChartView.SeriesTypeSpline, "signal 1", axisX, axisY1); - chartView.createSeries(ChartView.SeriesTypeSpline, "signal 2", axisX, axisY2); - } else { - var series1 = chartView.createSeries(ChartView.SeriesTypeScatter, "signal 1", axisX, axisY1); - series1.markerSize = 3; - series1.borderColor = "transparent"; - var series2 = chartView.createSeries(ChartView.SeriesTypeScatter, "signal 2", axisX, axisY2); - series2.markerSize = 3; - series2.borderColor = "transparent"; - } - } - - function createAxis(min, max) { - // The following creates a ValueAxis object that can be then set as a x or y axis for a series - return Qt.createQmlObject("import QtQuick 1.1; import QtCommercial.Chart 1.1; ValueAxis { min: " - + min + "; max: " + max + " }", chartView); - } - //![3] - - function setAnimations(enabled) { - if (enabled) - chartView.animationOptions = ChartView.SeriesAnimations; - else - chartView.animationOptions = ChartView.NoAnimation; - } - - function changeRefreshRate(rate) { - refreshTimer.interval = 1 / Number(rate) * 1000; - } -} diff --git a/demos/qmloscilloscope/qml/qmloscilloscope/main.qml b/demos/qmloscilloscope/qml/qmloscilloscope/main.qml deleted file mode 100644 index 2574e3bb..00000000 --- a/demos/qmloscilloscope/qml/qmloscilloscope/main.qml +++ /dev/null @@ -1,62 +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 - -//![1] -Rectangle { - id: main - width: 460 - height: 350 - color: "#404040" - - ControlPanel { - id: controlPanel - anchors.top: parent.top - anchors.topMargin: 10 - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.leftMargin: 10 -// ... -//![1] - - onSignalSourceChanged: { - if (source == "sin") - dataSource.generateData(0, signalCount, sampleCount); - else - dataSource.generateData(1, signalCount, sampleCount); - } - onAnimationsEnabled: scopeView.setAnimations(enabled); - onSeriesTypeChanged: scopeView.changeSeriesType(type); - onRefreshRateChanged: scopeView.changeRefreshRate(rate); - onAntialiasingEnabled: dataSource.setAntialiasing(enabled); - } - -//![2] - ScopeView { - id: scopeView - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.right: parent.right - anchors.left: controlPanel.right - height: main.height - } -//![2] -} diff --git a/demos/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.cpp b/demos/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index cb227056..00000000 --- a/demos/qmloscilloscope/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/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.h b/demos/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index adcb232f..00000000 --- a/demos/qmloscilloscope/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/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.pri b/demos/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.pri deleted file mode 100644 index 567c6dc6..00000000 --- a/demos/qmloscilloscope/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/qmloscilloscope/qmloscilloscope.pro b/demos/qmloscilloscope/qmloscilloscope.pro deleted file mode 100644 index 5bf080e8..00000000 --- a/demos/qmloscilloscope/qmloscilloscope.pro +++ /dev/null @@ -1,13 +0,0 @@ -!include( ../demos.pri ) { - error( "Couldn't find the demos.pri file!" ) -} - -RESOURCES += resources.qrc -SOURCES += main.cpp \ - datasource.cpp -OTHER_FILES += qml/qmloscilloscope/* - -include(qmlapplicationviewer/qmlapplicationviewer.pri) - -HEADERS += \ - datasource.h diff --git a/demos/qmloscilloscope/resources.qrc b/demos/qmloscilloscope/resources.qrc deleted file mode 100644 index e2aadae8..00000000 --- a/demos/qmloscilloscope/resources.qrc +++ /dev/null @@ -1,8 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>qml/qmloscilloscope/main.qml</file> - <file>qml/qmloscilloscope/ControlPanel.qml</file> - <file>qml/qmloscilloscope/ScopeView.qml</file> - <file>qml/qmloscilloscope/MultiButton.qml</file> - </qresource> -</RCC> |