diff options
22 files changed, 313 insertions, 260 deletions
diff --git a/examples/examples.pro b/examples/examples.pro index 73db54c0..316287f4 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -3,7 +3,8 @@ SUBDIRS += qmlbars \ qmlscatter \ qmlsurface \ qmlcustominput \ - qmllegend + qmllegend \ + qmlmultigraph !android: { SUBDIRS += bars \ diff --git a/examples/qmlbars/qml/qmlbars/data.qml b/examples/qmlbars/qml/qmlbars/data.qml index 5a17bcd1..e04950b4 100644 --- a/examples/qmlbars/qml/qmlbars/data.qml +++ b/examples/qmlbars/qml/qmlbars/data.qml @@ -17,7 +17,6 @@ ****************************************************************************/ import QtQuick 2.1 -import QtDataVisualization 1.0 Item { property alias model: dataModel diff --git a/examples/qmlcustominput/qml/qmlcustominput/data.qml b/examples/qmlcustominput/qml/qmlcustominput/data.qml index 1de07998..67f58a0c 100644 --- a/examples/qmlcustominput/qml/qmlcustominput/data.qml +++ b/examples/qmlcustominput/qml/qmlcustominput/data.qml @@ -17,7 +17,6 @@ ****************************************************************************/ import QtQuick 2.1 -import QtDataVisualization 1.0 Item { property alias model: dataModel diff --git a/examples/qmllegend/doc/src/qmllegend.qdoc b/examples/qmllegend/doc/src/qmllegend.qdoc index 6d210ffb..6d274aa4 100644 --- a/examples/qmllegend/doc/src/qmllegend.qdoc +++ b/examples/qmllegend/doc/src/qmllegend.qdoc @@ -27,7 +27,7 @@ \image qmllegend-example.png The interesting thing about this example is displaying the legend. We'll concentrate on - thate and skip explaining the basic functionality - for + that and skip explaining the basic functionality - for more detailed QML example documentation, see \l{Qt Quick 2 Scatter Example}. \section1 Legend diff --git a/examples/qmllegend/qml/qmllegend/data.qml b/examples/qmllegend/qml/qmllegend/data.qml index 3f15b8cd..8f827685 100644 --- a/examples/qmllegend/qml/qmllegend/data.qml +++ b/examples/qmllegend/qml/qmllegend/data.qml @@ -17,7 +17,6 @@ ****************************************************************************/ import QtQuick 2.1 -import QtDataVisualization 1.0 Item { property alias model: dataModel diff --git a/examples/qmlmultigraph/doc/src/qmlmultigraph.qdoc b/examples/qmlmultigraph/doc/src/qmlmultigraph.qdoc new file mode 100644 index 00000000..6fa43d57 --- /dev/null +++ b/examples/qmlmultigraph/doc/src/qmlmultigraph.qdoc @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 QtDataVisualization module. +** +** 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 +** +****************************************************************************/ + +/*! + \example qmlmultigraph + \title Qt Quick 2 Multiple Graphs Example + \ingroup qtdatavisualization_examples + \brief Showing multiple graphs simultaneously in a QML application. + + The Qt Quick 2 multiple graphs example demonstrates using multiple graphs in single window. + + \image qmlmultigraph-example.png + + The interesting thing about this example is demonstrating that multiple graphs can be used + simultaneously, so most functionality is not explained in detail. + For more detailed QML example documentation, see \l{Qt Quick 2 Scatter Example}. + + \section1 Multiple Graphs + + Using multiple graphs in a single application doesn't require anything special, simply define + and position the graphs as normal. In this example the graphs are shown side by side in a RowLayout: + + \snippet ../examples/qmlmultigraph/qml/qmlmultigraph/main.qml 0 + + Each graph has a parent Rectangle item to provide it with a border. The color of the rectangle is set + to fully transparent, because otherwise the rectangles would hide the graphs, which are always drawn behind + all other QML elements. +*/ diff --git a/tests/qmlmultigraph/main.cpp b/examples/qmlmultigraph/main.cpp index 9d9e5d8a..ff1bde71 100644 --- a/tests/qmlmultigraph/main.cpp +++ b/examples/qmlmultigraph/main.cpp @@ -39,10 +39,10 @@ int main(int argc, char *argv[]) viewer.engine()->addPluginPath(QString::fromLatin1("%1/../%2").arg(QDir::homePath(), QString::fromLatin1("lib"))); #endif - viewer.setTitle(QStringLiteral("QML multigraph test")); + viewer.setTitle(QStringLiteral("QML multigraph example")); viewer.setSource(QUrl("qrc:/qml/main.qml")); viewer.setResizeMode(QQuickView::SizeRootObjectToView); - viewer.showMaximized(); + viewer.showExpanded(); return app.exec(); } diff --git a/examples/qmlmultigraph/qml/qmlmultigraph/data.qml b/examples/qmlmultigraph/qml/qmlmultigraph/data.qml new file mode 100644 index 00000000..e9bed252 --- /dev/null +++ b/examples/qmlmultigraph/qml/qmlmultigraph/data.qml @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 QtDataVisualization module. +** +** 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 +** +****************************************************************************/ + +import QtQuick 2.1 + +Item { + property alias barData: barDataModel + property alias scatterData: scatterDataModel + property alias surfaceData: surfaceDataModel + + ListModel { + id: barDataModel + ListElement{ year: "2012"; city: "Oulu"; expenses: "4200"; income: "8300"; } + ListElement{ year: "2012"; city: "Kemi"; expenses: "2100"; income: "6500"; } + ListElement{ year: "2012"; city: "Helsinki"; expenses: "7040"; income: "7500"; } + ListElement{ year: "2012"; city: "Tampere"; expenses: "4330"; income: "5800"; } + ListElement{ year: "2013"; city: "Oulu"; expenses: "3960"; income: "9000"; } + ListElement{ year: "2013"; city: "Kemi"; expenses: "1990"; income: "3000"; } + ListElement{ year: "2013"; city: "Helsinki"; expenses: "7230"; income: "9900"; } + ListElement{ year: "2013"; city: "Tampere"; expenses: "4650"; income: "7600"; } + } + + ListModel { + id: scatterDataModel + ListElement{ xPos: "2.754"; yPos: "1.000"; zPos: "3.362"; } + ListElement{ xPos: "3.164"; yPos: "2.022"; zPos: "4.348"; } + ListElement{ xPos: "4.564"; yPos: "1.865"; zPos: "1.000"; } + ListElement{ xPos: "1.000"; yPos: "1.224"; zPos: "2.983"; } + ListElement{ xPos: "2.323"; yPos: "2.502"; zPos: "3.133"; } + ListElement{ xPos: "3.663"; yPos: "3.186"; zPos: "2.843"; } + ListElement{ xPos: "4.190"; yPos: "4.875"; zPos: "3.942"; } + ListElement{ xPos: "3.569"; yPos: "3.685"; zPos: "1.456"; } + ListElement{ xPos: "5.000"; yPos: "5.000"; zPos: "4.678"; } + ListElement{ xPos: "4.349"; yPos: "3.850"; zPos: "5.000"; } + } + + ListModel { + id: surfaceDataModel + ListElement{ longitude: "20"; latitude: "10"; pop_density: "4.75"; } + ListElement{ longitude: "21"; latitude: "10"; pop_density: "3.00"; } + ListElement{ longitude: "22"; latitude: "10"; pop_density: "1.24"; } + ListElement{ longitude: "23"; latitude: "10"; pop_density: "2.53"; } + ListElement{ longitude: "20"; latitude: "11"; pop_density: "3.55"; } + ListElement{ longitude: "21"; latitude: "11"; pop_density: "3.03"; } + ListElement{ longitude: "22"; latitude: "11"; pop_density: "3.46"; } + ListElement{ longitude: "23"; latitude: "11"; pop_density: "4.12"; } + ListElement{ longitude: "20"; latitude: "12"; pop_density: "3.37"; } + ListElement{ longitude: "21"; latitude: "12"; pop_density: "2.98"; } + ListElement{ longitude: "22"; latitude: "12"; pop_density: "3.33"; } + ListElement{ longitude: "23"; latitude: "12"; pop_density: "3.23"; } + ListElement{ longitude: "20"; latitude: "13"; pop_density: "5.34"; } + ListElement{ longitude: "21"; latitude: "13"; pop_density: "4.54"; } + ListElement{ longitude: "22"; latitude: "13"; pop_density: "4.65"; } + ListElement{ longitude: "23"; latitude: "13"; pop_density: "6.67"; } + ListElement{ longitude: "20"; latitude: "14"; pop_density: "6.01"; } + ListElement{ longitude: "21"; latitude: "14"; pop_density: "5.83"; } + ListElement{ longitude: "22"; latitude: "14"; pop_density: "5.90"; } + ListElement{ longitude: "23"; latitude: "14"; pop_density: "7.32"; } + } +} + diff --git a/examples/qmlmultigraph/qml/qmlmultigraph/main.qml b/examples/qmlmultigraph/qml/qmlmultigraph/main.qml new file mode 100644 index 00000000..27c6570e --- /dev/null +++ b/examples/qmlmultigraph/qml/qmlmultigraph/main.qml @@ -0,0 +1,169 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 QtDataVisualization module. +** +** 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 +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 +import QtDataVisualization 1.0 +import "." + +Item { + id: mainView + width: 1280 + height: 400 + + Data { + id: data + } + + //! [0] + RowLayout { + id: graphLayout + spacing: 1 + anchors.top: buttonLayout.bottom + anchors.bottom: mainView.bottom + anchors.left: mainView.left + anchors.right: mainView.right + + Rectangle { + Layout.fillHeight: true + Layout.fillWidth: true + border.color: surfaceGraph.theme.gridLineColor + border.width: 2 + color: "#00000000" // Transparent + + Surface3D { + id: surfaceGraph + anchors.fill: parent + anchors.margins: parent.border.width + theme: Theme3D { type: Theme3D.ThemePrimaryColors } + scene.activeCamera.cameraPreset: Camera3D.CameraPresetIsometricLeftHigh + + Surface3DSeries { + itemLabelFormat: "Pop density at (@xLabel N, @zLabel E): @yLabel" + ItemModelSurfaceDataProxy { + itemModel: data.surfaceData + // Mapping model roles to surface series rows, columns, and values. + rowRole: "longitude" + columnRole: "latitude" + valueRole: "pop_density" + } + } + } + } + + + Rectangle { + Layout.fillHeight: true + Layout.fillWidth: true + border.color: scatterGraph.theme.gridLineColor + border.width: 2 + color: "#00000000" // Transparent + + Scatter3D { + id: scatterGraph + anchors.fill: parent + anchors.margins: parent.border.width + theme: Theme3D { type: Theme3D.ThemeDigia } + scene.activeCamera.cameraPreset: Camera3D.CameraPresetIsometricLeftHigh + + Scatter3DSeries { + ItemModelScatterDataProxy { + itemModel: data.scatterData + // Mapping model roles to scatter series item coordinates. + xPosRole: "xPos" + yPosRole: "yPos" + zPosRole: "zPos" + } + } + } + } + + Rectangle { + Layout.fillHeight: true + Layout.fillWidth: true + border.color: barGraph.theme.gridLineColor + border.width: 2 + color: "#00000000" // Transparent + + Bars3D { + id: barGraph + anchors.fill: parent + anchors.margins: parent.border.width + theme: Theme3D { type: Theme3D.ThemeQt } + selectionMode: AbstractGraph3D.SelectionItemAndRow | AbstractGraph3D.SelectionSlice + scene.activeCamera.cameraPreset: Camera3D.CameraPresetIsometricLeftHigh + + Bar3DSeries { + itemLabelFormat: "@seriesName for @colLabel, @rowLabel: @valueLabel" + name: "Yearly expenses" + + ItemModelBarDataProxy { + itemModel: data.barData + // Mapping model roles to bar series rows, columns, and values. + rowRole: "year" + columnRole: "city" + valueRole: "expenses" + } + } + + Bar3DSeries { + itemLabelFormat: "@seriesName for @colLabel, @rowLabel: @valueLabel" + name: "Yearly income" + + ItemModelBarDataProxy { + itemModel: data.barData + // Mapping model roles to bar series rows, columns, and values. + rowRole: "year" + columnRole: "city" + valueRole: "income" + } + } + } + } + } + //! [0] + + RowLayout { + id: buttonLayout + Layout.minimumHeight: exitButton.height + width: parent.width + anchors.left: parent.left + anchors.top: parent.top + spacing: 0 + + NewButton { + id: clearSelectionsButton + Layout.fillHeight: true + Layout.fillWidth: true + text: "Clear Selections" + onClicked: { + barGraph.clearSelection() + scatterGraph.clearSelection() + surfaceGraph.clearSelection() + } + } + + NewButton { + id: exitButton + Layout.fillHeight: true + Layout.fillWidth: true + text: "Quit" + onClicked: Qt.quit(0); + } + } +} diff --git a/tests/qmlmultigraph/qml/qmlmultigraph/newbutton.qml b/examples/qmlmultigraph/qml/qmlmultigraph/newbutton.qml index e44c9d1a..e44c9d1a 100644 --- a/tests/qmlmultigraph/qml/qmlmultigraph/newbutton.qml +++ b/examples/qmlmultigraph/qml/qmlmultigraph/newbutton.qml diff --git a/examples/qmlmultigraph/qmlmultigraph.desktop b/examples/qmlmultigraph/qmlmultigraph.desktop new file mode 100644 index 00000000..90b16a4e --- /dev/null +++ b/examples/qmlmultigraph/qmlmultigraph.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=qmlmultigraph +Exec=/opt/qmlmultigraph/bin/qmlmultigraph +Icon=qmlmultigraph64 +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/tests/qmlmultigraph/qmlmultigraph.pro b/examples/qmlmultigraph/qmlmultigraph.pro index 1aca51c0..af4e0d90 100644 --- a/tests/qmlmultigraph/qmlmultigraph.pro +++ b/examples/qmlmultigraph/qmlmultigraph.pro @@ -1,5 +1,5 @@ -!include( ../tests.pri ) { - error( "Couldn't find the tests.pri file!" ) +!include( ../examples.pri ) { + error( "Couldn't find the examples.pri file!" ) } QT += widgets diff --git a/tests/qmlmultigraph/qmlmultigraph.qrc b/examples/qmlmultigraph/qmlmultigraph.qrc index 78a5f993..02e0c682 100644 --- a/tests/qmlmultigraph/qmlmultigraph.qrc +++ b/examples/qmlmultigraph/qmlmultigraph.qrc @@ -2,5 +2,6 @@ <qresource prefix="/qml"> <file alias="main.qml">qml/qmlmultigraph/main.qml</file> <file alias="NewButton.qml">qml/qmlmultigraph/newbutton.qml</file> + <file alias="Data.qml">qml/qmlmultigraph/data.qml</file> </qresource> </RCC> diff --git a/examples/qmlmultigraph/qmlmultigraph64.png b/examples/qmlmultigraph/qmlmultigraph64.png Binary files differnew file mode 100644 index 00000000..707d5c4e --- /dev/null +++ b/examples/qmlmultigraph/qmlmultigraph64.png diff --git a/tests/qmlmultigraph/qtquick2applicationviewer/qtquick2applicationviewer.cpp b/examples/qmlmultigraph/qtquick2applicationviewer/qtquick2applicationviewer.cpp index 10709d7a..10709d7a 100644 --- a/tests/qmlmultigraph/qtquick2applicationviewer/qtquick2applicationviewer.cpp +++ b/examples/qmlmultigraph/qtquick2applicationviewer/qtquick2applicationviewer.cpp diff --git a/tests/qmlmultigraph/qtquick2applicationviewer/qtquick2applicationviewer.h b/examples/qmlmultigraph/qtquick2applicationviewer/qtquick2applicationviewer.h index cf66f140..cf66f140 100644 --- a/tests/qmlmultigraph/qtquick2applicationviewer/qtquick2applicationviewer.h +++ b/examples/qmlmultigraph/qtquick2applicationviewer/qtquick2applicationviewer.h diff --git a/tests/qmlmultigraph/qtquick2applicationviewer/qtquick2applicationviewer.pri b/examples/qmlmultigraph/qtquick2applicationviewer/qtquick2applicationviewer.pri index e5f7990f..e5f7990f 100644 --- a/tests/qmlmultigraph/qtquick2applicationviewer/qtquick2applicationviewer.pri +++ b/examples/qmlmultigraph/qtquick2applicationviewer/qtquick2applicationviewer.pri diff --git a/examples/qmlscatter/qml/qmlscatter/data.qml b/examples/qmlscatter/qml/qmlscatter/data.qml index bf4853df..552a16d3 100644 --- a/examples/qmlscatter/qml/qmlscatter/data.qml +++ b/examples/qmlscatter/qml/qmlscatter/data.qml @@ -17,7 +17,6 @@ ****************************************************************************/ import QtQuick 2.1 -import QtDataVisualization 1.0 Item { //! [1] diff --git a/examples/qmlsurface/qml/qmlsurface/data.qml b/examples/qmlsurface/qml/qmlsurface/data.qml index 8637c29c..69c2e3c2 100644 --- a/examples/qmlsurface/qml/qmlsurface/data.qml +++ b/examples/qmlsurface/qml/qmlsurface/data.qml @@ -17,7 +17,6 @@ ****************************************************************************/ import QtQuick 2.1 -import QtDataVisualization 1.0 Item { property alias model: dataModel diff --git a/src/datavisualization/engine/q3dscene.cpp b/src/datavisualization/engine/q3dscene.cpp index c15610c1..74767762 100644 --- a/src/datavisualization/engine/q3dscene.cpp +++ b/src/datavisualization/engine/q3dscene.cpp @@ -199,8 +199,6 @@ void Q3DScene::setPrimarySubViewport(const QRect &primarySubViewport) /*! * Returns whether the given \a point resides inside the primary subview or not. - * The method takes care of correctly mapping between OpenGL coordinates used in the - * viewport definitions and the Qt event coordinate system used in the input system. * \return \c true if the point is inside the primary subview. */ bool Q3DScene::isPointInPrimarySubView(const QPoint &point) @@ -208,19 +206,15 @@ bool Q3DScene::isPointInPrimarySubView(const QPoint &point) int x = point.x(); int y = point.y(); int areaMinX = d_ptr->m_primarySubViewport.x(); - int areaMaxX = d_ptr->m_viewport.x() + d_ptr->m_primarySubViewport.x() - + d_ptr->m_primarySubViewport.width(); - int areaMaxY = d_ptr->m_viewport.y() + d_ptr->m_primarySubViewport.y() - + d_ptr->m_primarySubViewport.height(); - int areaMinY = d_ptr->m_viewport.y() + d_ptr->m_primarySubViewport.y(); + int areaMaxX = d_ptr->m_primarySubViewport.x() + d_ptr->m_primarySubViewport.width(); + int areaMinY = d_ptr->m_primarySubViewport.y(); + int areaMaxY = d_ptr->m_primarySubViewport.y() + d_ptr->m_primarySubViewport.height(); return ( x > areaMinX && x < areaMaxX && y > areaMinY && y < areaMaxY ); } /*! * Returns whether the given \a point resides inside the secondary subview or not. - * The method takes care of correctly mapping between OpenGL coordinates used in the - * viewport definitions and the Qt event coordinate system used in the input system. * \return \c true if the point is inside the secondary subview. */ bool Q3DScene::isPointInSecondarySubView(const QPoint &point) @@ -228,11 +222,9 @@ bool Q3DScene::isPointInSecondarySubView(const QPoint &point) int x = point.x(); int y = point.y(); int areaMinX = d_ptr->m_secondarySubViewport.x(); - int areaMaxX = d_ptr->m_viewport.x() + d_ptr->m_secondarySubViewport.x() - + d_ptr->m_secondarySubViewport.width(); - int areaMaxY = d_ptr->m_viewport.y() + d_ptr->m_secondarySubViewport.y() - + d_ptr->m_secondarySubViewport.height(); - int areaMinY = d_ptr->m_viewport.y() + d_ptr->m_secondarySubViewport.y(); + int areaMaxX = d_ptr->m_secondarySubViewport.x() + d_ptr->m_secondarySubViewport.width(); + int areaMinY = d_ptr->m_secondarySubViewport.y(); + int areaMaxY = d_ptr->m_secondarySubViewport.y() + d_ptr->m_secondarySubViewport.height(); return ( x > areaMinX && x < areaMaxX && y > areaMinY && y < areaMaxY ); } diff --git a/tests/qmlmultigraph/qml/qmlmultigraph/main.qml b/tests/qmlmultigraph/qml/qmlmultigraph/main.qml deleted file mode 100644 index 4f2f2052..00000000 --- a/tests/qmlmultigraph/qml/qmlmultigraph/main.qml +++ /dev/null @@ -1,234 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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 QtDataVisualization module. -** -** 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 -** -****************************************************************************/ - -import QtQuick 2.1 -import QtQuick.Layouts 1.0 -import QtDataVisualization 1.0 -import "." - -Item { - id: mainView - - Bars3D { - id: barGraph - width: parent.width / 3 - anchors.top: emptySpace.bottom - anchors.bottom: parent.bottom - theme: Theme3D { type: Theme3D.ThemeIsabelle } - //clearWindowBeforeRendering: false - - Bar3DSeries { - itemLabelFormat: "@colLabel, @rowLabel: @valueLabel" - - ItemModelBarDataProxy { - itemModel: barDataModel - // Mapping model roles to bar series rows, columns, and values. - rowRole: "year" - columnRole: "city" - valueRole: "expenses" - } - } - - Bar3DSeries { - itemLabelFormat: "@colLabel, @rowLabel: @valueLabel" - - ItemModelBarDataProxy { - itemModel: barDataModel - // Mapping model roles to bar series rows, columns, and values. - rowRole: "year" - columnRole: "city" - valueRole: "income" - } - } - - onRowAxisChanged: { - console.log("Bars: Row axis changed.") - } - onColumnAxisChanged: { - console.log("Bars: column axis changed.") - } - onValueAxisChanged: { - console.log("Bars: Value axis changed.") - } - } - - ListModel { - id: barDataModel - ListElement{ year: "2012"; city: "Oulu"; expenses: "4200"; income: "8300"; } - ListElement{ year: "2012"; city: "Rauma"; expenses: "2100"; income: "6500"; } - ListElement{ year: "2012"; city: "Helsinki"; expenses: "7040"; income: "7500"; } - ListElement{ year: "2012"; city: "Tampere"; expenses: "4330"; income: "5800"; } - ListElement{ year: "2013"; city: "Oulu"; expenses: "3960"; income: "9000"; } - ListElement{ year: "2013"; city: "Rauma"; expenses: "1990"; income: "3000"; } - ListElement{ year: "2013"; city: "Helsinki"; expenses: "7230"; income: "9900"; } - ListElement{ year: "2013"; city: "Tampere"; expenses: "4650"; income: "7600"; } - } - - Scatter3D { - id: scatterGraph - width: parent.width / 3 - anchors.left: barGraph.right - anchors.top: emptySpace.bottom - anchors.bottom: parent.bottom - theme: Theme3D { type: Theme3D.ThemeIsabelle } - //clearWindowBeforeRendering: false - - Scatter3DSeries { - ItemModelScatterDataProxy { - itemModel: scatterDataModel - // Mapping model roles to scatter series item coordinates. - xPosRole: "xPos" - yPosRole: "yPos" - zPosRole: "zPos" - } - } - - onAxisXChanged: { - console.log("Scatter: axis X changed.") - } - onAxisYChanged: { - console.log("Scatter: axis Y changed.") - } - onAxisZChanged: { - console.log("Scatter: axis Z changed.") - } - } - - ListModel { - id: scatterDataModel - ListElement{ xPos: "2.754"; yPos: "1.455"; zPos: "3.362"; } - ListElement{ xPos: "3.164"; yPos: "2.022"; zPos: "4.348"; } - ListElement{ xPos: "4.564"; yPos: "1.865"; zPos: "1.346"; } - ListElement{ xPos: "1.068"; yPos: "1.224"; zPos: "2.983"; } - ListElement{ xPos: "2.323"; yPos: "2.502"; zPos: "3.133"; } - } - - Surface3D { - id: surfaceGraph - width: parent.width / 3 - anchors.left: scatterGraph.right - anchors.top: emptySpace.bottom - anchors.bottom: parent.bottom - theme: Theme3D { type: Theme3D.ThemeIsabelle } - //clearWindowBeforeRendering: false - - Surface3DSeries { - itemLabelFormat: "Pop density at (@xLabel N, @zLabel E): @yLabel" - ItemModelSurfaceDataProxy { - itemModel: surfaceDataModel - // Mapping model roles to surface series rows, columns, and values. - rowRole: "longitude" - columnRole: "latitude" - valueRole: "pop_density" - } - } - - onAxisXChanged: { - console.log("Surface: axis X changed.") - } - onAxisYChanged: { - console.log("Surface: axis Y changed.") - } - onAxisZChanged: { - console.log("Surface: axis Z changed.") - } - } - ListModel { - id: surfaceDataModel - ListElement{ longitude: "20"; latitude: "10"; pop_density: "4.75"; } - ListElement{ longitude: "21"; latitude: "10"; pop_density: "3.00"; } - ListElement{ longitude: "22"; latitude: "10"; pop_density: "1.24"; } - ListElement{ longitude: "23"; latitude: "10"; pop_density: "2.53"; } - ListElement{ longitude: "20"; latitude: "11"; pop_density: "2.55"; } - ListElement{ longitude: "21"; latitude: "11"; pop_density: "2.03"; } - ListElement{ longitude: "22"; latitude: "11"; pop_density: "3.46"; } - ListElement{ longitude: "23"; latitude: "11"; pop_density: "5.12"; } - ListElement{ longitude: "20"; latitude: "12"; pop_density: "1.37"; } - ListElement{ longitude: "21"; latitude: "12"; pop_density: "2.98"; } - ListElement{ longitude: "22"; latitude: "12"; pop_density: "3.33"; } - ListElement{ longitude: "23"; latitude: "12"; pop_density: "3.23"; } - ListElement{ longitude: "20"; latitude: "13"; pop_density: "4.34"; } - ListElement{ longitude: "21"; latitude: "13"; pop_density: "3.54"; } - ListElement{ longitude: "22"; latitude: "13"; pop_density: "1.65"; } - ListElement{ longitude: "23"; latitude: "13"; pop_density: "2.67"; } - } - - RowLayout { - id: buttonLayout - Layout.minimumHeight: exitButton.height - width: parent.width - anchors.left: parent.left - anchors.top: parent.top - spacing: 0 - - NewButton { - id: exitButton - Layout.fillHeight: true - Layout.fillWidth: true - text: "Quit" - onClicked: Qt.quit(0); - } - - NewButton { - id: resetAxesButton - Layout.fillHeight: true - Layout.fillWidth: true - text: "Reset axes" - onClicked: { - barGraph.rowAxis = null - barGraph.columnAxis = null - barGraph.valueAxis = null - scatterGraph.axisX = null - scatterGraph.axisY = null - scatterGraph.axisZ = null - surfaceGraph.axisX = null - surfaceGraph.axisY = null - surfaceGraph.axisZ = null - } - } - - NewButton { - id: clearSelectionsButton - Layout.fillHeight: true - Layout.fillWidth: true - text: "Clear Selections" - onClicked: { - barGraph.clearSelection() - scatterGraph.clearSelection() - surfaceGraph.clearSelection() - } - } - } - - Rectangle { - id: emptySpace - width: parent.width / 2 - height: parent.height / 8 - anchors.top: buttonLayout.bottom - anchors.left: parent.left - color: "#55555500" - } - - Item { - id: emptySpace2 - width: emptySpace.width - height: emptySpace.height - anchors.top: buttonLayout.bottom - anchors.left: emptySpace.right - } -} diff --git a/tests/tests.pro b/tests/tests.pro index 41c0bee9..ec28d997 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -13,7 +13,6 @@ SUBDIRS += barstest \ qmlcamera \ qmldynamicdata \ multigraphs \ - qmlmultigraph \ directional #SUBDIRS += kinectsurface |