diff options
Diffstat (limited to 'demos/qmlcustomlegend')
13 files changed, 0 insertions, 859 deletions
diff --git a/demos/qmlcustomlegend/main.cpp b/demos/qmlcustomlegend/main.cpp deleted file mode 100644 index 774b3ffc..00000000 --- a/demos/qmlcustomlegend/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/qmlcustomlegend/loader.qml")); - viewer->setRenderHint(QPainter::Antialiasing, true); - viewer->showExpanded(); - - return app->exec(); -} diff --git a/demos/qmlcustomlegend/qml/qmlcustomlegend/AnimatedAreaSeries.qml b/demos/qmlcustomlegend/qml/qmlcustomlegend/AnimatedAreaSeries.qml deleted file mode 100755 index 8173b5d6..00000000 --- a/demos/qmlcustomlegend/qml/qmlcustomlegend/AnimatedAreaSeries.qml +++ /dev/null @@ -1,30 +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
-
-AreaSeries {
- id: series
-
- Behavior on opacity {
- NumberAnimation { duration: 250 }
- }
-}
diff --git a/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewHighlighted.qml b/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewHighlighted.qml deleted file mode 100755 index c0b66672..00000000 --- a/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewHighlighted.qml +++ /dev/null @@ -1,76 +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: chartViewHighlighted
- title: ""
- property variant selectedSeries
- signal clicked
- legend.visible: false
- margins.top: 10
- margins.bottom: 0
-
- LineSeries {
- id: lineSeries
-
- axisX: ValueAxis {
- min: 2006
- max: 2012
- labelFormat: "%.0f"
- tickCount: 7
- }
- axisY: ValueAxis {
- id: axisY
- titleText: "EUR"
- min: 0
- max: 40000
- niceNumbersEnabled: true
- labelFormat: "%.0f"
- tickCount: 5
- }
- }
-//![1]
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- chartViewHighlighted.clicked();
- }
- }
-
- onSelectedSeriesChanged: {
- lineSeries.clear();
- lineSeries.color = selectedSeries.color;
- var maxVal = 0.0;
- for (var i = 0; i < selectedSeries.upperSeries.count; i++ ) {
- var y = selectedSeries.upperSeries.at(i).y - selectedSeries.lowerSeries.at(i).y;
- lineSeries.append(selectedSeries.upperSeries.at(i).x, y);
- if (maxVal < y)
- maxVal = y;
- }
- chartViewHighlighted.title = selectedSeries.name;
- axisY.max = maxVal;
- }
-}
-
diff --git a/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewSelector.qml b/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewSelector.qml deleted file mode 100755 index 60680934..00000000 --- a/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewSelector.qml +++ /dev/null @@ -1,100 +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 {
- id: chartViewSelector
- width: parent.width
- height: parent.height
- signal seriesAdded(string seriesName, color seriesColor)
-
- function highlightSeries(seriesName) {
- if (seriesName == "") {
- if (state != "")
- state = "";
-
- for (var i = 0; i < chartViewStacked.count; i++)
- chartViewStacked.series(i).opacity = 1.0;
- } else {
- var targetOpacity = 0.1;
- for (var j = 0; j < chartViewStacked.count; j++) {
- if (chartViewStacked.series(j).name != seriesName)
- chartViewStacked.series(j).opacity = 0.25;
- else if (state == "highlight")
- chartViewSelected.selectedSeries = chartViewStacked.series(j);
- }
- }
- }
-
- function selectSeries(seriesName) {
- for (var i = 0; i < chartViewStacked.count; i++) {
- if (chartViewStacked.series(i).name == seriesName) {
- chartViewSelected.selectedSeries = chartViewStacked.series(i);
- if (chartViewSelector.state == "")
- chartViewSelector.state = "highlighted";
- else
- chartViewSelector.state = "";
- }
- }
- }
-
- ChartViewStacked {
- id: chartViewStacked
- anchors.left: parent.left
- anchors.leftMargin: 0
- width: parent.width
- height: parent.height
- onSeriesAdded: chartViewSelector.seriesAdded(series.name, series.color);
- }
-
- ChartViewHighlighted {
- id: chartViewSelected
- anchors.left: chartViewStacked.right
- width: parent.width
- height: parent.height
-
- opacity: 0.0
- onClicked: {
- chartViewSelector.state = "";
- }
- }
-
- states: State {
- name: "highlighted"
- PropertyChanges {
- target: chartViewSelected
- opacity: 1.0
- }
- PropertyChanges {
- target: chartViewStacked
- anchors.leftMargin: -chartViewStacked.width
- opacity: 0.0
- }
- }
-
- transitions: Transition {
- PropertyAnimation {
- properties: "width, height, opacity, anchors.leftMargin"
- duration: 400
- }
- }
-}
diff --git a/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewStacked.qml b/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewStacked.qml deleted file mode 100755 index 365da46a..00000000 --- a/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewStacked.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
-
-ChartView {
- id: chartView
- title: "Government Taxes"
- legend.visible: false
- signal entered(string seriesName)
- signal exited(string seriesName)
- margins.top: 10
- margins.bottom: 0
-
- ValueAxis {
- id: axisX
- min: 2006
- max: 2012
- tickCount: 7
- labelFormat: "%.0f"
- }
-
- ValueAxis {
- id: axisY
- titleText: "EUR"
- min: 0
- max: 90000
- tickCount: 10
- labelFormat: "%.0f"
- }
-
- AnimatedAreaSeries {
- id: stateSeries
- name: "state"
- axisX: axisX
- axisY: axisY
- borderWidth: 0
- upperSeries: LineSeries {
- id: stateUpper
- XYPoint { x: 2006; y: 33119 }
- XYPoint { x: 2007; y: 37941 }
- XYPoint { x: 2008; y: 40122 }
- XYPoint { x: 2009; y: 38991 }
- XYPoint { x: 2010; y: 34055 }
- XYPoint { x: 2011; y: 34555 }
- XYPoint { x: 2012; y: 38991 }
- }
- lowerSeries: LineSeries {
- XYPoint { x: 2006; y: 0 }
- XYPoint { x: 2007; y: 0 }
- XYPoint { x: 2008; y: 0 }
- XYPoint { x: 2009; y: 0 }
- XYPoint { x: 2010; y: 0 }
- XYPoint { x: 2011; y: 0 }
- XYPoint { x: 2012; y: 0 }
- }
- }
-
- //![1]
- AnimatedAreaSeries {
- id: municipalSeries
- name: "municipal"
- axisX: axisX
- axisY: axisY
- borderWidth: 0
- upperSeries: LineSeries {
- id: municipalUpper
- XYPoint { x: 2006; y: 33119 + 13443 }
- XYPoint { x: 2007; y: 37941 + 15311 }
- XYPoint { x: 2008; y: 40122 + 16552 }
- XYPoint { x: 2009; y: 38991 + 17904 }
- XYPoint { x: 2010; y: 34055 + 17599 }
- XYPoint { x: 2011; y: 34555 + 19002 }
- XYPoint { x: 2012; y: 38991 + 19177 }
- }
- lowerSeries: stateUpper
- }
- //![1]
-
- AnimatedAreaSeries {
- id: socialSeries
- name: "social sec."
- axisX: axisX
- axisY: axisY
- borderWidth: 0
- upperSeries: LineSeries {
- id: socialUpper
- XYPoint { x: 2006; y: 33119 + 13443 + 18855 }
- XYPoint { x: 2007; y: 37941 + 15311 + 20238 }
- XYPoint { x: 2008; y: 40122 + 16552 + 21347 }
- XYPoint { x: 2009; y: 38991 + 17904 + 22376 }
- XYPoint { x: 2010; y: 34055 + 17599 + 22076 }
- XYPoint { x: 2011; y: 34555 + 19002 + 22631 }
- XYPoint { x: 2012; y: 38991 + 19177 + 23686 }
- }
- lowerSeries: municipalUpper
- }
-}
diff --git a/demos/qmlcustomlegend/qml/qmlcustomlegend/CustomLegend.qml b/demos/qmlcustomlegend/qml/qmlcustomlegend/CustomLegend.qml deleted file mode 100755 index 578eed26..00000000 --- a/demos/qmlcustomlegend/qml/qmlcustomlegend/CustomLegend.qml +++ /dev/null @@ -1,135 +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 {
- id: legend
- color: "lightgray"
- property int seriesCount: 0
- property variant seriesNames: []
- property variant seriesColors: []
- signal entered(string seriesName)
- signal exited(string seriesName)
- signal selected(string seriesName)
-
- function addSeries(seriesName, color) {
- var names = seriesNames;
- names[seriesCount] = seriesName;
- seriesNames = names;
-
- var colors = seriesColors;
- colors[seriesCount] = color;
- seriesColors = colors;
-
- seriesCount++;
- }
-
- Gradient {
- id: buttonGradient
- GradientStop { position: 0.0; color: "#F0F0F0" }
- GradientStop { position: 1.0; color: "#A0A0A0" }
- }
-
- Gradient {
- id: buttonGradientHovered
- GradientStop { position: 0.0; color: "#FFFFFF" }
- GradientStop { position: 1.0; color: "#B0B0B0" }
- }
-
- //![2]
- Component {
- id: legendDelegate
- Rectangle {
- id: rect
- // ...
- //![2]
- property string name: seriesNames[index]
- property color markerColor: seriesColors[index]
- gradient: buttonGradient
- border.color: "#A0A0A0"
- border.width: 1
- radius: 4
- height: 20
- width: 100
-
- Row {
- id: row
- spacing: 5
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 5
- Rectangle {
- id: marker
- anchors.verticalCenter: parent.verticalCenter
- color: markerColor
- opacity: 0.3
- radius: 4
- width: 12
- height: 10
- }
- Text {
- id: label
- anchors.verticalCenter: parent.verticalCenter
- anchors.verticalCenterOffset: -1
- text: name
- }
- }
-
- //![3]
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- hoverEnabled: true
- onEntered: {
- rect.gradient = buttonGradientHovered;
- legend.entered(label.text);
- }
- onExited: {
- rect.gradient = buttonGradient;
- legend.exited(label.text);
- marker.opacity = 0.3;
- marker.height = 10;
- }
- onClicked: {
- legend.selected(label.text);
- marker.opacity = 1.0;
- marker.height = 12;
- }
- }
- //![3]
- }
- }
-
- //![1]
- Row {
- id: legendRow
- anchors.centerIn: parent
- spacing: 6
-
- Repeater {
- id: legendRepeater
- model: seriesCount
- delegate: legendDelegate
- }
- }
- //![1]
-}
diff --git a/demos/qmlcustomlegend/qml/qmlcustomlegend/loader.qml b/demos/qmlcustomlegend/qml/qmlcustomlegend/loader.qml deleted file mode 100755 index 1b09580d..00000000 --- a/demos/qmlcustomlegend/qml/qmlcustomlegend/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: 320
- 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/qmlcustomlegend/qml/qmlcustomlegend/main.qml b/demos/qmlcustomlegend/qml/qmlcustomlegend/main.qml deleted file mode 100755 index 1e91b10b..00000000 --- a/demos/qmlcustomlegend/qml/qmlcustomlegend/main.qml +++ /dev/null @@ -1,66 +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 {
- id: main
- width: parent.width
- height: parent.height
-
- Column {
- id: column
- anchors.fill: parent
- anchors.bottomMargin: 10
- spacing: 0
-
- ChartViewSelector {
- id: chartViewSelector
- width: parent.width
- height: parent.height - customLegend.height - anchors.bottomMargin
- onSeriesAdded: customLegend.addSeries(seriesName, seriesColor);
- }
-
- CustomLegend {
- id: customLegend
- width: parent.width
- height: 35
- anchors.horizontalCenter: parent.horizontalCenter
- onEntered: chartViewSelector.highlightSeries(seriesName);
- onExited: chartViewSelector.highlightSeries("");
- onSelected: chartViewSelector.selectSeries(seriesName);
- }
- }
-
- states: State {
- name: "highlighted"
- PropertyChanges {
- target: chartViewHighlighted
- width: column.width
- height: (column.height - column.anchors.margins * 2 - customLegend.height)
- }
- PropertyChanges {
- target: chartViewStacked
- width: 1
- height: 1
- }
- }
-}
diff --git a/demos/qmlcustomlegend/qmlapplicationviewer/qmlapplicationviewer.cpp b/demos/qmlcustomlegend/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index cb227056..00000000 --- a/demos/qmlcustomlegend/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/qmlcustomlegend/qmlapplicationviewer/qmlapplicationviewer.h b/demos/qmlcustomlegend/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index adcb232f..00000000 --- a/demos/qmlcustomlegend/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/qmlcustomlegend/qmlapplicationviewer/qmlapplicationviewer.pri b/demos/qmlcustomlegend/qmlapplicationviewer/qmlapplicationviewer.pri deleted file mode 100644 index 567c6dc6..00000000 --- a/demos/qmlcustomlegend/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/qmlcustomlegend/qmlcustomlegend.pro b/demos/qmlcustomlegend/qmlcustomlegend.pro deleted file mode 100755 index fc376490..00000000 --- a/demos/qmlcustomlegend/qmlcustomlegend.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/qmlcustomlegend/*
-
-include(qmlapplicationviewer/qmlapplicationviewer.pri)
diff --git a/demos/qmlcustomlegend/resources.qrc b/demos/qmlcustomlegend/resources.qrc deleted file mode 100755 index 5c3ad444..00000000 --- a/demos/qmlcustomlegend/resources.qrc +++ /dev/null @@ -1,11 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>qml/qmlcustomlegend/loader.qml</file> - <file>qml/qmlcustomlegend/main.qml</file> - <file>qml/qmlcustomlegend/CustomLegend.qml</file> - <file>qml/qmlcustomlegend/ChartViewStacked.qml</file> - <file>qml/qmlcustomlegend/ChartViewHighlighted.qml</file> - <file>qml/qmlcustomlegend/ChartViewSelector.qml</file> - <file>qml/qmlcustomlegend/AnimatedAreaSeries.qml</file> - </qresource> -</RCC> |