mirror of https://github.com/qt/qtgraphs.git
Check for invalid aspect ratio values
At the same time, fix unqualified accesses in the touched test files. Pick-to: 6.8 Fixes: QTBUG-131730 Change-Id: Ib840c9f745751ee4738a62ca39df7d3d7b0699e4 Reviewed-by: Sami Varanka <sami.varanka@qt.io> Reviewed-by: Sakaria Pouke <sakaria.pouke@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
This commit is contained in:
parent
2acad5b4ba
commit
dfefb422ff
|
|
@ -5372,7 +5372,7 @@ QtGraphs3D::ElementType QQuickGraphsItem::selectedElement() const
|
||||||
|
|
||||||
void QQuickGraphsItem::setAspectRatio(qreal ratio)
|
void QQuickGraphsItem::setAspectRatio(qreal ratio)
|
||||||
{
|
{
|
||||||
if (m_aspectRatio != ratio) {
|
if (m_aspectRatio != ratio && ratio > 0.0) {
|
||||||
m_aspectRatio = ratio;
|
m_aspectRatio = ratio;
|
||||||
m_changeTracker.aspectRatioChanged = true;
|
m_changeTracker.aspectRatioChanged = true;
|
||||||
emit aspectRatioChanged(m_aspectRatio);
|
emit aspectRatioChanged(m_aspectRatio);
|
||||||
|
|
@ -5454,7 +5454,7 @@ float QQuickGraphsItem::radialLabelOffset() const
|
||||||
|
|
||||||
void QQuickGraphsItem::setHorizontalAspectRatio(qreal ratio)
|
void QQuickGraphsItem::setHorizontalAspectRatio(qreal ratio)
|
||||||
{
|
{
|
||||||
if (m_horizontalAspectRatio != ratio) {
|
if (m_horizontalAspectRatio != ratio && ratio > 0.0) {
|
||||||
m_horizontalAspectRatio = ratio;
|
m_horizontalAspectRatio = ratio;
|
||||||
m_changeTracker.horizontalAspectRatioChanged = true;
|
m_changeTracker.horizontalAspectRatioChanged = true;
|
||||||
emit horizontalAspectRatioChanged(m_horizontalAspectRatio);
|
emit horizontalAspectRatioChanged(m_horizontalAspectRatio);
|
||||||
|
|
|
||||||
|
|
@ -296,8 +296,8 @@ void tst_bars::invalidProperties()
|
||||||
m_graph->setLocale(QLocale("XX"));
|
m_graph->setLocale(QLocale("XX"));
|
||||||
|
|
||||||
QCOMPARE(m_graph->selectionMode(), QtGraphs3D::SelectionFlag::Item);
|
QCOMPARE(m_graph->selectionMode(), QtGraphs3D::SelectionFlag::Item);
|
||||||
QCOMPARE(m_graph->aspectRatio(), -1.0/*2.0*/); // TODO: Fix once QTRD-3367 is done
|
QCOMPARE(m_graph->aspectRatio(), 2.0);
|
||||||
QCOMPARE(m_graph->horizontalAspectRatio(), -1.0/*0.0*/); // TODO: Fix once QTRD-3367 is done
|
QCOMPARE(m_graph->horizontalAspectRatio(), 0.0);
|
||||||
QCOMPARE(m_graph->locale(), QLocale("C"));
|
QCOMPARE(m_graph->locale(), QLocale("C"));
|
||||||
|
|
||||||
m_graph->setAmbientLightStrength(-1.0f);
|
m_graph->setAmbientLightStrength(-1.0f);
|
||||||
|
|
|
||||||
|
|
@ -152,8 +152,8 @@ void tst_scatter::invalidProperties()
|
||||||
m_graph->setCameraTargetPosition(QVector3D(2.f, -2.f, -2.f));
|
m_graph->setCameraTargetPosition(QVector3D(2.f, -2.f, -2.f));
|
||||||
|
|
||||||
QCOMPARE(m_graph->selectionMode(), QtGraphs3D::SelectionFlag::Item);
|
QCOMPARE(m_graph->selectionMode(), QtGraphs3D::SelectionFlag::Item);
|
||||||
QCOMPARE(m_graph->aspectRatio(), -1.0/*2.0*/); // TODO: Fix once QTRD-3367 is done
|
QCOMPARE(m_graph->aspectRatio(), 2.0);
|
||||||
QCOMPARE(m_graph->horizontalAspectRatio(), -1.0/*0.0*/); // TODO: Fix once QTRD-3367 is done
|
QCOMPARE(m_graph->horizontalAspectRatio(), 0.0);
|
||||||
QCOMPARE(m_graph->locale(), QLocale("C"));
|
QCOMPARE(m_graph->locale(), QLocale("C"));
|
||||||
QCOMPARE(m_graph->cameraTargetPosition(), QVector3D(1.f, -1.f, -1.f));
|
QCOMPARE(m_graph->cameraTargetPosition(), QVector3D(1.f, -1.f, -1.f));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -164,8 +164,8 @@ void tst_surface::invalidProperties()
|
||||||
m_graph->setCameraTargetPosition(QVector3D(2.f, -2.f, -2.f));
|
m_graph->setCameraTargetPosition(QVector3D(2.f, -2.f, -2.f));
|
||||||
|
|
||||||
QCOMPARE(m_graph->selectionMode(), QtGraphs3D::SelectionFlag::Item);
|
QCOMPARE(m_graph->selectionMode(), QtGraphs3D::SelectionFlag::Item);
|
||||||
QCOMPARE(m_graph->aspectRatio(), -1.0/*2.0*/); // TODO: Fix once QTRD-3367 is done
|
QCOMPARE(m_graph->aspectRatio(), 2.0);
|
||||||
QCOMPARE(m_graph->horizontalAspectRatio(), -1.0/*0.0*/); // TODO: Fix once QTRD-3367 is done
|
QCOMPARE(m_graph->horizontalAspectRatio(), 0.0);
|
||||||
QCOMPARE(m_graph->locale(), QLocale("C"));
|
QCOMPARE(m_graph->locale(), QLocale("C"));
|
||||||
QCOMPARE(m_graph->cameraTargetPosition(), QVector3D(1.f, -1.f, -1.f));
|
QCOMPARE(m_graph->cameraTargetPosition(), QVector3D(1.f, -1.f, -1.f));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,71 +15,71 @@ Item {
|
||||||
property var common_init: null
|
property var common_init: null
|
||||||
|
|
||||||
function constructEmpty() {
|
function constructEmpty() {
|
||||||
empty = Qt.createQmlObject("
|
empty = Qt.createQmlObject(`
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtGraphs
|
import QtGraphs
|
||||||
Bars3D {
|
Bars3D {
|
||||||
}", top)
|
}`, top)
|
||||||
}
|
}
|
||||||
|
|
||||||
function constructBasic() {
|
function constructBasic() {
|
||||||
basic = Qt.createQmlObject("
|
basic = Qt.createQmlObject(`
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtGraphs
|
import QtGraphs
|
||||||
Bars3D {
|
Bars3D {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
multiSeriesUniform: true
|
multiSeriesUniform: true
|
||||||
barThickness: 0.1
|
barThickness: 0.1
|
||||||
barSpacing.width: 0.1
|
barSpacing.width: 0.1
|
||||||
barSpacing.height: 0.1
|
barSpacing.height: 0.1
|
||||||
barSeriesMargin.width: 0.3
|
barSeriesMargin.width: 0.3
|
||||||
barSeriesMargin.height: 0.3
|
barSeriesMargin.height: 0.3
|
||||||
barSpacingRelative: false
|
barSpacingRelative: false
|
||||||
floorLevel: 1.0
|
floorLevel: 1.0
|
||||||
}", top)
|
}`, top)
|
||||||
basic.anchors.fill = top
|
top.basic.anchors.fill = top
|
||||||
}
|
}
|
||||||
|
|
||||||
function constructCommon() {
|
function constructCommon() {
|
||||||
common = Qt.createQmlObject("
|
common = Qt.createQmlObject(`
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtGraphs
|
import QtGraphs
|
||||||
Bars3D {
|
Bars3D {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}", top)
|
}`, top)
|
||||||
common.anchors.fill = top
|
common.anchors.fill = top
|
||||||
}
|
}
|
||||||
|
|
||||||
function constructCommonInit() {
|
function constructCommonInit() {
|
||||||
common_init = Qt.createQmlObject("
|
common_init = Qt.createQmlObject(`
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtGraphs
|
import QtGraphs
|
||||||
Bars3D {
|
Bars3D {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
selectionMode: Graphs3D.SelectionFlag.None
|
selectionMode: Graphs3D.SelectionFlag.None
|
||||||
shadowQuality: Graphs3D.ShadowQuality.Low
|
shadowQuality: Graphs3D.ShadowQuality.Low
|
||||||
msaaSamples: 2
|
msaaSamples: 2
|
||||||
theme: GraphsTheme { }
|
theme: GraphsTheme { }
|
||||||
renderingMode: Graphs3D.RenderingMode.Indirect
|
renderingMode: Graphs3D.RenderingMode.Indirect
|
||||||
measureFps: true
|
measureFps: true
|
||||||
orthoProjection: false
|
orthoProjection: false
|
||||||
aspectRatio: 3.0
|
aspectRatio: 3.0
|
||||||
optimizationHint: Graphs3D.OptimizationHint.Default
|
optimizationHint: Graphs3D.OptimizationHint.Default
|
||||||
polar: false
|
polar: false
|
||||||
radialLabelOffset: 2
|
radialLabelOffset: 2
|
||||||
horizontalAspectRatio: 0.2
|
horizontalAspectRatio: 0.2
|
||||||
locale: Qt.locale(\"UK\")
|
locale: Qt.locale("UK")
|
||||||
margin: 0.2
|
margin: 0.2
|
||||||
labelMargin: 0.2
|
labelMargin: 0.2
|
||||||
lightColor: \"black\"
|
lightColor: "black"
|
||||||
ambientLightStrength: 0.5
|
ambientLightStrength: 0.5
|
||||||
lightStrength: 10.0
|
lightStrength: 10.0
|
||||||
shadowStrength: 50.0
|
shadowStrength: 50.0
|
||||||
minCameraXRotation: 0.0
|
minCameraXRotation: 0.0
|
||||||
maxCameraXRotation: 90.0
|
maxCameraXRotation: 90.0
|
||||||
minCameraYRotation: -90.0
|
minCameraYRotation: -90.0
|
||||||
maxCameraYRotation: 0.0
|
maxCameraYRotation: 0.0
|
||||||
}", top)
|
}`, top)
|
||||||
common_init.anchors.fill = top
|
common_init.anchors.fill = top
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -88,26 +88,26 @@ maxCameraYRotation: 0.0
|
||||||
when: windowShown
|
when: windowShown
|
||||||
|
|
||||||
function test_empty() {
|
function test_empty() {
|
||||||
constructEmpty()
|
top.constructEmpty()
|
||||||
compare(empty.width, 0, "width")
|
compare(top.empty.width, 0, "width")
|
||||||
compare(empty.height, 0, "height")
|
compare(top.empty.height, 0, "height")
|
||||||
compare(empty.multiSeriesUniform, false, "multiSeriesUniform")
|
compare(top.empty.multiSeriesUniform, false, "multiSeriesUniform")
|
||||||
compare(empty.barThickness, 1.0, "barThickness")
|
compare(top.empty.barThickness, 1.0, "barThickness")
|
||||||
compare(empty.barSpacing, Qt.size(1.0, 1.0), "barSpacing")
|
compare(top.empty.barSpacing, Qt.size(1.0, 1.0), "barSpacing")
|
||||||
compare(empty.barSeriesMargin, Qt.size(0.0, 0.0), "barSeriesMargin")
|
compare(top.empty.barSeriesMargin, Qt.size(0.0, 0.0), "barSeriesMargin")
|
||||||
compare(empty.barSpacingRelative, true, "barSpacingRelative")
|
compare(top.empty.barSpacingRelative, true, "barSpacingRelative")
|
||||||
compare(empty.seriesList.length, 0, "seriesList")
|
compare(top.empty.seriesList.length, 0, "seriesList")
|
||||||
compare(empty.selectedSeries, null, "selectedSeries")
|
compare(top.empty.selectedSeries, null, "selectedSeries")
|
||||||
compare(empty.primarySeries, null, "primarySeries")
|
compare(top.empty.primarySeries, null, "primarySeries")
|
||||||
compare(empty.floorLevel, 0.0, "floorLevel")
|
compare(top.empty.floorLevel, 0.0, "floorLevel")
|
||||||
compare(empty.columnAxis.orientation, Abstract3DAxis.AxisOrientation.X)
|
compare(top.empty.columnAxis.orientation, Abstract3DAxis.AxisOrientation.X)
|
||||||
compare(empty.rowAxis.orientation, Abstract3DAxis.AxisOrientation.Z)
|
compare(top.empty.rowAxis.orientation, Abstract3DAxis.AxisOrientation.Z)
|
||||||
compare(empty.valueAxis.orientation, Abstract3DAxis.AxisOrientation.Y)
|
compare(top.empty.valueAxis.orientation, Abstract3DAxis.AxisOrientation.Y)
|
||||||
compare(empty.columnAxis.type, Abstract3DAxis.AxisType.Category)
|
compare(top.empty.columnAxis.type, Abstract3DAxis.AxisType.Category)
|
||||||
compare(empty.rowAxis.type, Abstract3DAxis.AxisType.Category)
|
compare(top.empty.rowAxis.type, Abstract3DAxis.AxisType.Category)
|
||||||
compare(empty.valueAxis.type, Abstract3DAxis.AxisType.Value)
|
compare(top.empty.valueAxis.type, Abstract3DAxis.AxisType.Value)
|
||||||
waitForRendering(top)
|
waitForRendering(top)
|
||||||
empty.destroy()
|
top.empty.destroy()
|
||||||
waitForRendering(top)
|
waitForRendering(top)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -117,45 +117,45 @@ maxCameraYRotation: 0.0
|
||||||
when: windowShown
|
when: windowShown
|
||||||
|
|
||||||
function test_1_basic() {
|
function test_1_basic() {
|
||||||
constructBasic()
|
top.constructBasic()
|
||||||
compare(basic.width, 150, "width")
|
compare(top.basic.width, 150, "width")
|
||||||
compare(basic.height, 150, "height")
|
compare(top.basic.height, 150, "height")
|
||||||
compare(basic.multiSeriesUniform, true, "multiSeriesUniform")
|
compare(top.basic.multiSeriesUniform, true, "multiSeriesUniform")
|
||||||
compare(basic.barThickness, 0.1, "barThickness")
|
compare(top.basic.barThickness, 0.1, "barThickness")
|
||||||
compare(basic.barSpacing, Qt.size(0.1, 0.1), "barSpacing")
|
compare(top.basic.barSpacing, Qt.size(0.1, 0.1), "barSpacing")
|
||||||
compare(basic.barSeriesMargin, Qt.size(0.3, 0.3), "barSeriesMargin")
|
compare(top.basic.barSeriesMargin, Qt.size(0.3, 0.3), "barSeriesMargin")
|
||||||
compare(basic.barSpacingRelative, false, "barSpacingRelative")
|
compare(top.basic.barSpacingRelative, false, "barSpacingRelative")
|
||||||
compare(basic.floorLevel, 1.0, "floorLevel")
|
compare(top.basic.floorLevel, 1.0, "floorLevel")
|
||||||
waitForRendering(top)
|
waitForRendering(top)
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_2_basic_change() {
|
function test_2_basic_change() {
|
||||||
basic.multiSeriesUniform = false
|
top.basic.multiSeriesUniform = false
|
||||||
basic.barThickness = 0.5
|
top.basic.barThickness = 0.5
|
||||||
basic.barSpacing = Qt.size(1.0, 0.0)
|
top.basic.barSpacing = Qt.size(1.0, 0.0)
|
||||||
basic.barSeriesMargin = Qt.size(0.5, 0.0)
|
top.basic.barSeriesMargin = Qt.size(0.5, 0.0)
|
||||||
basic.barSpacingRelative = true
|
top.basic.barSpacingRelative = true
|
||||||
basic.floorLevel = 0.2
|
top.basic.floorLevel = 0.2
|
||||||
compare(basic.multiSeriesUniform, false, "multiSeriesUniform")
|
compare(top.basic.multiSeriesUniform, false, "multiSeriesUniform")
|
||||||
compare(basic.barThickness, 0.5, "barThickness")
|
compare(top.basic.barThickness, 0.5, "barThickness")
|
||||||
compare(basic.barSpacing, Qt.size(1.0, 0.0), "barSpacing")
|
compare(top.basic.barSpacing, Qt.size(1.0, 0.0), "barSpacing")
|
||||||
compare(basic.barSeriesMargin, Qt.size(0.5, 0.0), "barSeriesMargin")
|
compare(top.basic.barSeriesMargin, Qt.size(0.5, 0.0), "barSeriesMargin")
|
||||||
compare(basic.barSpacingRelative, true, "barSpacingRelative")
|
compare(top.basic.barSpacingRelative, true, "barSpacingRelative")
|
||||||
compare(basic.floorLevel, 0.2, "floorLevel")
|
compare(top.basic.floorLevel, 0.2, "floorLevel")
|
||||||
waitForRendering(top)
|
waitForRendering(top)
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_3_basic_change_invalid() {
|
function test_3_basic_change_invalid() {
|
||||||
basic.barThickness = -1
|
top.basic.barThickness = -1
|
||||||
basic.barSpacing = Qt.size(-1.0, -1.0)
|
top.basic.barSpacing = Qt.size(-1.0, -1.0)
|
||||||
basic.barSeriesMargin = Qt.size(-1.0, -1.0)
|
top.basic.barSeriesMargin = Qt.size(-1.0, -1.0)
|
||||||
compare(basic.barThickness, -1 /*0.5*/
|
compare(top.basic.barThickness, -1 /*0.5*/
|
||||||
, "barThickness") // TODO: Fix once QTRD-3367 is done
|
, "barThickness") // TODO: Fix once QTRD-3367 is done
|
||||||
compare(basic.barSpacing, Qt.size(-1.0, -1.0), "barSpacing")
|
compare(top.basic.barSpacing, Qt.size(-1.0, -1.0), "barSpacing")
|
||||||
compare(basic.barSeriesMargin, Qt.size(-1.0, -1.0),
|
compare(top.basic.barSeriesMargin, Qt.size(-1.0, -1.0),
|
||||||
"barSeriesMargin")
|
"barSeriesMargin")
|
||||||
waitForRendering(top)
|
waitForRendering(top)
|
||||||
basic.destroy()
|
top.basic.destroy()
|
||||||
waitForRendering(top)
|
waitForRendering(top)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -165,190 +165,187 @@ maxCameraYRotation: 0.0
|
||||||
when: windowShown
|
when: windowShown
|
||||||
|
|
||||||
function test_1_common() {
|
function test_1_common() {
|
||||||
constructCommon()
|
top.constructCommon()
|
||||||
compare(common.selectionMode, Graphs3D.SelectionFlag.Item,
|
compare(top.common.selectionMode, Graphs3D.SelectionFlag.Item,
|
||||||
"selectionMode")
|
"selectionMode")
|
||||||
compare(common.shadowQuality, Graphs3D.ShadowQuality.Medium,
|
compare(top.common.shadowQuality, Graphs3D.ShadowQuality.Medium,
|
||||||
"shadowQuality")
|
"shadowQuality")
|
||||||
compare(common.msaaSamples, 4, "msaaSamples")
|
compare(top.common.msaaSamples, 4, "msaaSamples")
|
||||||
compare(common.theme.theme, GraphsTheme.Theme.QtGreen, "theme")
|
compare(top.common.theme.theme, GraphsTheme.Theme.QtGreen, "theme")
|
||||||
compare(common.renderingMode, Graphs3D.RenderingMode.Indirect,
|
compare(top.common.renderingMode, Graphs3D.RenderingMode.Indirect,
|
||||||
"renderingMode")
|
"renderingMode")
|
||||||
compare(common.measureFps, false, "measureFps")
|
compare(top.common.measureFps, false, "measureFps")
|
||||||
compare(common.customItemList.length, 0, "customItemList")
|
compare(top.common.customItemList.length, 0, "customItemList")
|
||||||
compare(common.orthoProjection, false, "orthoProjection")
|
compare(top.common.orthoProjection, false, "orthoProjection")
|
||||||
compare(common.selectedElement, Graphs3D.ElementType.None,
|
compare(top.common.selectedElement, Graphs3D.ElementType.None,
|
||||||
"selectedElement")
|
"selectedElement")
|
||||||
compare(common.aspectRatio, 2.0, "aspectRatio")
|
compare(top.common.aspectRatio, 2.0, "aspectRatio")
|
||||||
compare(common.optimizationHint, Graphs3D.OptimizationHint.Default,
|
compare(top.common.optimizationHint, Graphs3D.OptimizationHint.Default,
|
||||||
"optimizationHint")
|
"optimizationHint")
|
||||||
compare(common.polar, false, "polar")
|
compare(top.common.polar, false, "polar")
|
||||||
compare(common.radialLabelOffset, 1, "radialLabelOffset")
|
compare(top.common.radialLabelOffset, 1, "radialLabelOffset")
|
||||||
compare(common.horizontalAspectRatio, 0, "horizontalAspectRatio")
|
compare(top.common.horizontalAspectRatio, 0, "horizontalAspectRatio")
|
||||||
compare(common.locale, Qt.locale("C"), "locale")
|
compare(top.common.locale, Qt.locale("C"), "locale")
|
||||||
compare(common.queriedGraphPosition, Qt.vector3d(0, 0, 0),
|
compare(top.common.queriedGraphPosition, Qt.vector3d(0, 0, 0),
|
||||||
"queriedGraphPosition")
|
"queriedGraphPosition")
|
||||||
compare(common.margin, -1, "margin")
|
compare(top.common.margin, -1, "margin")
|
||||||
compare(common.labelMargin, 0.1, "labelMargin")
|
compare(top.common.labelMargin, 0.1, "labelMargin")
|
||||||
compare(common.lightColor, "#ffffff", "lightColor")
|
compare(top.common.lightColor, "#ffffff", "lightColor")
|
||||||
compare(common.ambientLightStrength, 0.25, "ambientLightStrength")
|
compare(top.common.ambientLightStrength, 0.25, "ambientLightStrength")
|
||||||
compare(common.lightStrength, 5.0, "lightStrength")
|
compare(top.common.lightStrength, 5.0, "lightStrength")
|
||||||
compare(common.shadowStrength, 25.0, "shadowStrength")
|
compare(top.common.shadowStrength, 25.0, "shadowStrength")
|
||||||
compare(common.minCameraXRotation, -180.0, "minCameraXRotation")
|
compare(top.common.minCameraXRotation, -180.0, "minCameraXRotation")
|
||||||
compare(common.maxCameraXRotation, 180.0, "maxCameraXRotation")
|
compare(top.common.maxCameraXRotation, 180.0, "maxCameraXRotation")
|
||||||
compare(common.minCameraYRotation, 0.0, "minCameraYRotation")
|
compare(top.common.minCameraYRotation, 0.0, "minCameraYRotation")
|
||||||
compare(common.maxCameraYRotation, 90.0, "maxCameraYRotation")
|
compare(top.common.maxCameraYRotation, 90.0, "maxCameraYRotation")
|
||||||
compare(common.cameraTargetPosition, Qt.vector3d(0, 0, 0),
|
compare(top.common.cameraTargetPosition, Qt.vector3d(0, 0, 0),
|
||||||
"cameraTargetPosition")
|
"cameraTargetPosition")
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_2_change_common() {
|
function test_2_change_common() {
|
||||||
common.selectionMode = Graphs3D.SelectionFlag.Item
|
top.common.selectionMode = Graphs3D.SelectionFlag.Item
|
||||||
| Graphs3D.SelectionFlag.Row | Graphs3D.SelectionFlag.Slice
|
| Graphs3D.SelectionFlag.Row | Graphs3D.SelectionFlag.Slice
|
||||||
common.shadowQuality = Graphs3D.ShadowQuality.SoftHigh
|
top.common.shadowQuality = Graphs3D.ShadowQuality.SoftHigh
|
||||||
compare(common.shadowQuality, Graphs3D.ShadowQuality.SoftHigh,
|
compare(top.common.shadowQuality, Graphs3D.ShadowQuality.SoftHigh,
|
||||||
"shadowQuality")
|
"shadowQuality")
|
||||||
common.msaaSamples = 8
|
top.common.msaaSamples = 8
|
||||||
compare(common.msaaSamples, 8, "msaaSamples")
|
compare(top.common.msaaSamples, 8, "msaaSamples")
|
||||||
common.theme.theme = GraphsTheme.Theme.QtGreenNeon
|
top.common.theme.theme = GraphsTheme.Theme.QtGreenNeon
|
||||||
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
||||||
// common.renderingMode = Graphs3D.RenderingMode.DirectToBackground
|
// top.common.renderingMode = Graphs3D.RenderingMode.DirectToBackground
|
||||||
common.measureFps = true
|
top.common.measureFps = true
|
||||||
common.orthoProjection = true
|
top.common.orthoProjection = true
|
||||||
common.aspectRatio = 1.0
|
top.common.aspectRatio = 1.0
|
||||||
common.optimizationHint = Graphs3D.OptimizationHint.Default
|
top.common.optimizationHint = Graphs3D.OptimizationHint.Default
|
||||||
common.polar = true
|
top.common.polar = true
|
||||||
common.radialLabelOffset = 2
|
top.common.radialLabelOffset = 2
|
||||||
common.horizontalAspectRatio = 1
|
top.common.horizontalAspectRatio = 1
|
||||||
common.locale = Qt.locale("FI")
|
top.common.locale = Qt.locale("FI")
|
||||||
common.margin = 1.0
|
top.common.margin = 1.0
|
||||||
common.labelMargin = 1.0
|
top.common.labelMargin = 1.0
|
||||||
common.lightColor = "#ff0000"
|
top.common.lightColor = "#ff0000"
|
||||||
common.ambientLightStrength = 0.5
|
top.common.ambientLightStrength = 0.5
|
||||||
common.lightStrength = 10.0
|
top.common.lightStrength = 10.0
|
||||||
common.shadowStrength = 50.0
|
top.common.shadowStrength = 50.0
|
||||||
common.minCameraXRotation = 0
|
top.common.minCameraXRotation = 0
|
||||||
common.maxCameraXRotation = 90
|
top.common.maxCameraXRotation = 90
|
||||||
common.minCameraYRotation = -90
|
top.common.minCameraYRotation = -90
|
||||||
common.maxCameraYRotation = 0
|
top.common.maxCameraYRotation = 0
|
||||||
common.cameraTargetPosition = Qt.vector3d(1.0, 0.0, -1.0)
|
top.common.cameraTargetPosition = Qt.vector3d(1.0, 0.0, -1.0)
|
||||||
|
|
||||||
compare(common.selectionMode,
|
compare(top.common.selectionMode,
|
||||||
Graphs3D.SelectionFlag.Item | Graphs3D.SelectionFlag.Row
|
Graphs3D.SelectionFlag.Item | Graphs3D.SelectionFlag.Row
|
||||||
| Graphs3D.SelectionFlag.Slice, "selectionMode")
|
| Graphs3D.SelectionFlag.Slice, "selectionMode")
|
||||||
compare(common.shadowQuality, Graphs3D.ShadowQuality.None,
|
compare(top.common.shadowQuality, Graphs3D.ShadowQuality.None,
|
||||||
"shadowQuality") // Ortho disables shadows
|
"shadowQuality") // Ortho disables shadows
|
||||||
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
||||||
// compare(common.msaaSamples, 0, "msaaSamples") // Rendering mode changes this to zero
|
// compare(top.common.msaaSamples, 0, "msaaSamples") // Rendering mode changes this to zero
|
||||||
compare(common.theme.theme, GraphsTheme.Theme.QtGreenNeon, "theme")
|
compare(top.common.theme.theme, GraphsTheme.Theme.QtGreenNeon, "theme")
|
||||||
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
||||||
// compare(common.renderingMode, Graphs3D.RenderingMode.DirectToBackground, "renderingMode")
|
// compare(top.common.renderingMode, Graphs3D.RenderingMode.DirectToBackground, "renderingMode")
|
||||||
compare(common.measureFps, true, "measureFps")
|
compare(top.common.measureFps, true, "measureFps")
|
||||||
compare(common.orthoProjection, true, "orthoProjection")
|
compare(top.common.orthoProjection, true, "orthoProjection")
|
||||||
compare(common.aspectRatio, 1.0, "aspectRatio")
|
compare(top.common.aspectRatio, 1.0, "aspectRatio")
|
||||||
compare(common.optimizationHint, Graphs3D.OptimizationHint.Default,
|
compare(top.common.optimizationHint, Graphs3D.OptimizationHint.Default,
|
||||||
"optimizationHint")
|
"optimizationHint")
|
||||||
compare(common.polar, true, "polar")
|
compare(top.common.polar, true, "polar")
|
||||||
compare(common.radialLabelOffset, 2, "radialLabelOffset")
|
compare(top.common.radialLabelOffset, 2, "radialLabelOffset")
|
||||||
compare(common.horizontalAspectRatio, 1, "horizontalAspectRatio")
|
compare(top.common.horizontalAspectRatio, 1, "horizontalAspectRatio")
|
||||||
compare(common.locale, Qt.locale("FI"), "locale")
|
compare(top.common.locale, Qt.locale("FI"), "locale")
|
||||||
compare(common.margin, 1.0, "margin")
|
compare(top.common.margin, 1.0, "margin")
|
||||||
compare(common.labelMargin, 1.0, "labelMargin")
|
compare(top.common.labelMargin, 1.0, "labelMargin")
|
||||||
compare(common.lightColor, "#ff0000", "lightColor")
|
compare(top.common.lightColor, "#ff0000", "lightColor")
|
||||||
compare(common.ambientLightStrength, 0.5, "ambientLightStrength")
|
compare(top.common.ambientLightStrength, 0.5, "ambientLightStrength")
|
||||||
compare(common.lightStrength, 10.0, "lightStrength")
|
compare(top.common.lightStrength, 10.0, "lightStrength")
|
||||||
compare(common.shadowStrength, 50.0, "shadowStrength")
|
compare(top.common.shadowStrength, 50.0, "shadowStrength")
|
||||||
compare(common.minCameraXRotation, 0.0, "minCameraXRotation")
|
compare(top.common.minCameraXRotation, 0.0, "minCameraXRotation")
|
||||||
compare(common.maxCameraXRotation, 90.0, "maxCameraXRotation")
|
compare(top.common.maxCameraXRotation, 90.0, "maxCameraXRotation")
|
||||||
compare(common.minCameraYRotation, -90.0, "minCameraYRotation")
|
compare(top.common.minCameraYRotation, -90.0, "minCameraYRotation")
|
||||||
compare(common.maxCameraYRotation, 0.0, "maxCameraYRotation")
|
compare(top.common.maxCameraYRotation, 0.0, "maxCameraYRotation")
|
||||||
compare(common.cameraTargetPosition, Qt.vector3d(1.0, 0.0, -1.0),
|
compare(top.common.cameraTargetPosition, Qt.vector3d(1.0, 0.0, -1.0),
|
||||||
"cameraTargetPosition")
|
"cameraTargetPosition")
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_3_change_invalid_common() {
|
function test_3_change_invalid_common() {
|
||||||
common.selectionMode = Graphs3D.SelectionFlag.Row
|
top.common.selectionMode = Graphs3D.SelectionFlag.Row
|
||||||
| Graphs3D.SelectionFlag.Column | Graphs3D.SelectionFlag.Slice
|
| Graphs3D.SelectionFlag.Column | Graphs3D.SelectionFlag.Slice
|
||||||
common.theme.theme = -2
|
top.common.theme.theme = -2
|
||||||
common.renderingMode = -1
|
top.common.renderingMode = -1
|
||||||
common.measureFps = false
|
top.common.measureFps = false
|
||||||
common.orthoProjection = false
|
top.common.orthoProjection = false
|
||||||
common.aspectRatio = -1.0
|
top.common.aspectRatio = -1.0
|
||||||
common.polar = false
|
top.common.polar = false
|
||||||
common.horizontalAspectRatio = -2
|
top.common.horizontalAspectRatio = -2
|
||||||
compare(common.selectionMode,
|
compare(top.common.selectionMode,
|
||||||
Graphs3D.SelectionFlag.Item | Graphs3D.SelectionFlag.Row
|
Graphs3D.SelectionFlag.Item | Graphs3D.SelectionFlag.Row
|
||||||
| Graphs3D.SelectionFlag.Slice, "selectionMode")
|
| Graphs3D.SelectionFlag.Slice, "selectionMode")
|
||||||
compare(common.theme.theme, -2 /*GraphsTheme.GreySeries*/
|
compare(top.common.theme.theme, -2 /*GraphsTheme.GreySeries*/
|
||||||
, "theme") // TODO: Fix once QTRD-3367 is done
|
, "theme") // TODO: Fix once QTRD-3367 is done
|
||||||
compare(common.renderingMode,
|
compare(top.common.renderingMode,
|
||||||
-1 /*Graphs3D.RenderingMode.DirectToBackground*/
|
-1 /*Graphs3D.RenderingMode.DirectToBackground*/
|
||||||
, "renderingMode") // TODO: Fix once QTRD-3367 is done
|
, "renderingMode") // TODO: Fix once QTRD-3367 is done
|
||||||
compare(common.aspectRatio, -1.0 /*1.0*/
|
compare(top.common.aspectRatio, 1.0, "aspectRatio")
|
||||||
, "aspectRatio") // TODO: Fix once QTRD-3367 is done
|
compare(top.common.horizontalAspectRatio, 1, "horizontalAspectRatio")
|
||||||
compare(common.horizontalAspectRatio, -2 /*1*/
|
|
||||||
,
|
|
||||||
"horizontalAspectRatio") // TODO: Fix once QTRD-3367 is done
|
|
||||||
|
|
||||||
common.destroy()
|
top.common.destroy()
|
||||||
|
|
||||||
constructCommon()
|
top.constructCommon()
|
||||||
|
|
||||||
common.ambientLightStrength = -1.0
|
top.common.ambientLightStrength = -1.0
|
||||||
compare(common.ambientLightStrength, 0.25, "ambientLightStrength")
|
compare(top.common.ambientLightStrength, 0.25, "ambientLightStrength")
|
||||||
common.ambientLightStrength = -1.1
|
top.common.ambientLightStrength = -1.1
|
||||||
compare(common.ambientLightStrength, 0.25, "ambientLightStrength")
|
compare(top.common.ambientLightStrength, 0.25, "ambientLightStrength")
|
||||||
common.lightStrength = 11.0
|
top.common.lightStrength = 11.0
|
||||||
compare(common.lightStrength, 5.0, "lightStrength")
|
compare(top.common.lightStrength, 5.0, "lightStrength")
|
||||||
common.lightStrength = -1.0
|
top.common.lightStrength = -1.0
|
||||||
compare(common.lightStrength, 5.0, "lightStrength")
|
compare(top.common.lightStrength, 5.0, "lightStrength")
|
||||||
common.shadowStrength = 101.0
|
top.common.shadowStrength = 101.0
|
||||||
compare(common.shadowStrength, 25.0, "shadowStrength")
|
compare(top.common.shadowStrength, 25.0, "shadowStrength")
|
||||||
common.shadowStrength = -1.0
|
top.common.shadowStrength = -1.0
|
||||||
compare(common.shadowStrength, 25.0, "shadowStrength")
|
compare(top.common.shadowStrength, 25.0, "shadowStrength")
|
||||||
|
|
||||||
common.cameraTargetPosition = Qt.vector3d(2.0, 1.0, -2.0)
|
top.common.cameraTargetPosition = Qt.vector3d(2.0, 1.0, -2.0)
|
||||||
compare(common.cameraTargetPosition, Qt.vector3d(1.0, 1.0, -1.0),
|
compare(top.common.cameraTargetPosition, Qt.vector3d(1.0, 1.0, -1.0),
|
||||||
"cameraTargetPosition")
|
"cameraTargetPosition")
|
||||||
|
|
||||||
common.destroy()
|
top.common.destroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_4_common_initialized() {
|
function test_4_common_initialized() {
|
||||||
constructCommonInit()
|
top.constructCommonInit()
|
||||||
|
|
||||||
compare(common_init.selectionMode, Graphs3D.SelectionFlag.None,
|
compare(top.common_init.selectionMode, Graphs3D.SelectionFlag.None,
|
||||||
"selectionMode")
|
"selectionMode")
|
||||||
tryCompare(common_init, "shadowQuality", Graphs3D.ShadowQuality.Low)
|
tryCompare(top.common_init, "shadowQuality", Graphs3D.ShadowQuality.Low)
|
||||||
compare(common_init.msaaSamples, 2, "msaaSamples")
|
compare(top.common_init.msaaSamples, 2, "msaaSamples")
|
||||||
compare(common_init.theme.theme,
|
compare(top.common_init.theme.theme,
|
||||||
GraphsTheme.Theme.QtGreen, "theme")
|
GraphsTheme.Theme.QtGreen, "theme")
|
||||||
compare(common_init.renderingMode, Graphs3D.RenderingMode.Indirect,
|
compare(top.common_init.renderingMode, Graphs3D.RenderingMode.Indirect,
|
||||||
"renderingMode")
|
"renderingMode")
|
||||||
compare(common_init.measureFps, true, "measureFps")
|
compare(top.common_init.measureFps, true, "measureFps")
|
||||||
compare(common_init.customItemList.length, 0, "customItemList")
|
compare(top.common_init.customItemList.length, 0, "customItemList")
|
||||||
compare(common_init.orthoProjection, false, "orthoProjection")
|
compare(top.common_init.orthoProjection, false, "orthoProjection")
|
||||||
compare(common_init.aspectRatio, 3.0, "aspectRatio")
|
compare(top.common_init.aspectRatio, 3.0, "aspectRatio")
|
||||||
compare(common_init.optimizationHint,
|
compare(top.common_init.optimizationHint,
|
||||||
Graphs3D.OptimizationHint.Default, "optimizationHint")
|
Graphs3D.OptimizationHint.Default, "optimizationHint")
|
||||||
compare(common_init.polar, false, "polar")
|
compare(top.common_init.polar, false, "polar")
|
||||||
compare(common_init.radialLabelOffset, 2, "radialLabelOffset")
|
compare(top.common_init.radialLabelOffset, 2, "radialLabelOffset")
|
||||||
compare(common_init.horizontalAspectRatio, 0.2,
|
compare(top.common_init.horizontalAspectRatio, 0.2,
|
||||||
"horizontalAspectRatio")
|
"horizontalAspectRatio")
|
||||||
compare(common_init.locale, Qt.locale("UK"), "locale")
|
compare(top.common_init.locale, Qt.locale("UK"), "locale")
|
||||||
compare(common_init.margin, 0.2, "margin")
|
compare(top.common_init.margin, 0.2, "margin")
|
||||||
compare(common_init.labelMargin, 0.2, "labelMargin")
|
compare(top.common_init.labelMargin, 0.2, "labelMargin")
|
||||||
compare(common_init.lightColor, "#000000", "lightColor")
|
compare(top.common_init.lightColor, "#000000", "lightColor")
|
||||||
compare(common_init.ambientLightStrength, 0.5,
|
compare(top.common_init.ambientLightStrength, 0.5,
|
||||||
"ambientLightStrength")
|
"ambientLightStrength")
|
||||||
compare(common_init.lightStrength, 10.0, "lightStrength")
|
compare(top.common_init.lightStrength, 10.0, "lightStrength")
|
||||||
compare(common_init.shadowStrength, 50.0, "shadowStrength")
|
compare(top.common_init.shadowStrength, 50.0, "shadowStrength")
|
||||||
compare(common_init.minCameraXRotation, 0.0, "minCameraXRotation")
|
compare(top.common_init.minCameraXRotation, 0.0, "minCameraXRotation")
|
||||||
compare(common_init.maxCameraXRotation, 90.0, "maxCameraXRotation")
|
compare(top.common_init.maxCameraXRotation, 90.0, "maxCameraXRotation")
|
||||||
compare(common_init.minCameraYRotation, -90.0, "minCameraYRotation")
|
compare(top.common_init.minCameraYRotation, -90.0, "minCameraYRotation")
|
||||||
compare(common_init.maxCameraYRotation, 0.0, "maxCameraYRotation")
|
compare(top.common_init.maxCameraYRotation, 0.0, "maxCameraYRotation")
|
||||||
|
|
||||||
common_init.destroy()
|
top.common_init.destroy()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,59 +16,59 @@ Item {
|
||||||
property var common_init: null
|
property var common_init: null
|
||||||
|
|
||||||
function constructEmpty() {
|
function constructEmpty() {
|
||||||
empty = Qt.createQmlObject("
|
empty = Qt.createQmlObject(`
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtGraphs
|
import QtGraphs
|
||||||
Scatter3D {
|
Scatter3D {
|
||||||
}", top)
|
}`, top)
|
||||||
}
|
}
|
||||||
|
|
||||||
function constructBasic() {
|
function constructBasic() {
|
||||||
basic = Qt.createQmlObject("
|
basic = Qt.createQmlObject(`
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtGraphs
|
import QtGraphs
|
||||||
Scatter3D {
|
Scatter3D {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}", top)
|
}`, top)
|
||||||
basic.anchors.fill = top
|
basic.anchors.fill = top
|
||||||
}
|
}
|
||||||
|
|
||||||
function constructCommon() {
|
function constructCommon() {
|
||||||
common = Qt.createQmlObject("
|
common = Qt.createQmlObject(`
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtGraphs
|
import QtGraphs
|
||||||
Scatter3D {
|
Scatter3D {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}", top)
|
}`, top)
|
||||||
common.anchors.fill = top
|
common.anchors.fill = top
|
||||||
}
|
}
|
||||||
|
|
||||||
function constructCommonInit() {
|
function constructCommonInit() {
|
||||||
common_init = Qt.createQmlObject("
|
common_init = Qt.createQmlObject(`
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtGraphs
|
import QtGraphs
|
||||||
Scatter3D {
|
Scatter3D {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
selectionMode: Graphs3D.SelectionFlag.None
|
selectionMode: Graphs3D.SelectionFlag.None
|
||||||
shadowQuality: Graphs3D.ShadowQuality.Low
|
shadowQuality: Graphs3D.ShadowQuality.Low
|
||||||
msaaSamples: 2
|
msaaSamples: 2
|
||||||
theme: GraphsTheme { }
|
theme: GraphsTheme { }
|
||||||
renderingMode: Graphs3D.RenderingMode.Indirect
|
renderingMode: Graphs3D.RenderingMode.Indirect
|
||||||
measureFps: true
|
measureFps: true
|
||||||
orthoProjection: false
|
orthoProjection: false
|
||||||
aspectRatio: 3.0
|
aspectRatio: 3.0
|
||||||
optimizationHint: Graphs3D.OptimizationHint.Default
|
optimizationHint: Graphs3D.OptimizationHint.Default
|
||||||
polar: false
|
polar: false
|
||||||
radialLabelOffset: 2
|
radialLabelOffset: 2
|
||||||
horizontalAspectRatio: 0.2
|
horizontalAspectRatio: 0.2
|
||||||
locale: Qt.locale(\"UK\")
|
locale: Qt.locale("UK")
|
||||||
margin: 0.2
|
margin: 0.2
|
||||||
labelMargin: 0.2
|
labelMargin: 0.2
|
||||||
lightColor: \"black\"
|
lightColor: "black"
|
||||||
ambientLightStrength: 0.5
|
ambientLightStrength: 0.5
|
||||||
lightStrength: 10.0
|
lightStrength: 10.0
|
||||||
shadowStrength: 50.0
|
shadowStrength: 50.0
|
||||||
}", top)
|
}`, top)
|
||||||
common_init.anchors.fill = top
|
common_init.anchors.fill = top
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -77,19 +77,19 @@ shadowStrength: 50.0
|
||||||
when: windowShown
|
when: windowShown
|
||||||
|
|
||||||
function test_empty() {
|
function test_empty() {
|
||||||
constructEmpty()
|
top.constructEmpty()
|
||||||
compare(empty.width, 0, "width")
|
compare(top.empty.width, 0, "width")
|
||||||
compare(empty.height, 0, "height")
|
compare(top.empty.height, 0, "height")
|
||||||
compare(empty.seriesList.length, 0, "seriesList")
|
compare(top.empty.seriesList.length, 0, "seriesList")
|
||||||
compare(empty.selectedSeries, null, "selectedSeries")
|
compare(top.empty.selectedSeries, null, "selectedSeries")
|
||||||
compare(empty.axisX.orientation, Abstract3DAxis.AxisOrientation.X)
|
compare(top.empty.axisX.orientation, Abstract3DAxis.AxisOrientation.X)
|
||||||
compare(empty.axisZ.orientation, Abstract3DAxis.AxisOrientation.Z)
|
compare(top.empty.axisZ.orientation, Abstract3DAxis.AxisOrientation.Z)
|
||||||
compare(empty.axisY.orientation, Abstract3DAxis.AxisOrientation.Y)
|
compare(top.empty.axisY.orientation, Abstract3DAxis.AxisOrientation.Y)
|
||||||
compare(empty.axisX.type, Abstract3DAxis.AxisType.Value)
|
compare(top.empty.axisX.type, Abstract3DAxis.AxisType.Value)
|
||||||
compare(empty.axisZ.type, Abstract3DAxis.AxisType.Value)
|
compare(top.empty.axisZ.type, Abstract3DAxis.AxisType.Value)
|
||||||
compare(empty.axisY.type, Abstract3DAxis.AxisType.Value)
|
compare(top.empty.axisY.type, Abstract3DAxis.AxisType.Value)
|
||||||
waitForRendering(top)
|
waitForRendering(top)
|
||||||
empty.destroy()
|
top.empty.destroy()
|
||||||
waitForRendering(top)
|
waitForRendering(top)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -99,11 +99,11 @@ shadowStrength: 50.0
|
||||||
when: windowShown
|
when: windowShown
|
||||||
|
|
||||||
function test_basic() {
|
function test_basic() {
|
||||||
constructBasic()
|
top.constructBasic()
|
||||||
compare(basic.width, 150, "width")
|
compare(top.basic.width, 150, "width")
|
||||||
compare(basic.height, 150, "height")
|
compare(top.basic.height, 150, "height")
|
||||||
waitForRendering(top)
|
waitForRendering(top)
|
||||||
basic.destroy()
|
top.basic.destroy()
|
||||||
waitForRendering(top)
|
waitForRendering(top)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -113,175 +113,172 @@ shadowStrength: 50.0
|
||||||
when: windowShown
|
when: windowShown
|
||||||
|
|
||||||
function test_1_common() {
|
function test_1_common() {
|
||||||
constructCommon()
|
top.constructCommon()
|
||||||
compare(common.selectionMode,
|
compare(top.common.selectionMode,
|
||||||
Graphs3D.SelectionFlag.Item, "selectionMode")
|
Graphs3D.SelectionFlag.Item, "selectionMode")
|
||||||
compare(common.shadowQuality,
|
compare(top.common.shadowQuality,
|
||||||
Graphs3D.ShadowQuality.Medium,
|
Graphs3D.ShadowQuality.Medium,
|
||||||
"shadowQuality")
|
"shadowQuality")
|
||||||
compare(common.msaaSamples, 4, "msaaSamples")
|
compare(top.common.msaaSamples, 4, "msaaSamples")
|
||||||
compare(common.theme.theme, GraphsTheme.Theme.QtGreen, "theme")
|
compare(top.common.theme.theme, GraphsTheme.Theme.QtGreen, "theme")
|
||||||
compare(common.renderingMode,
|
compare(top.common.renderingMode,
|
||||||
Graphs3D.RenderingMode.Indirect,
|
Graphs3D.RenderingMode.Indirect,
|
||||||
"renderingMode")
|
"renderingMode")
|
||||||
compare(common.measureFps, false, "measureFps")
|
compare(top.common.measureFps, false, "measureFps")
|
||||||
compare(common.customItemList.length, 0, "customItemList")
|
compare(top.common.customItemList.length, 0, "customItemList")
|
||||||
compare(common.orthoProjection, false, "orthoProjection")
|
compare(top.common.orthoProjection, false, "orthoProjection")
|
||||||
compare(common.selectedElement,
|
compare(top.common.selectedElement,
|
||||||
Graphs3D.ElementType.None, "selectedElement")
|
Graphs3D.ElementType.None, "selectedElement")
|
||||||
compare(common.aspectRatio, 2.0, "aspectRatio")
|
compare(top.common.aspectRatio, 2.0, "aspectRatio")
|
||||||
compare(common.optimizationHint,
|
compare(top.common.optimizationHint,
|
||||||
Graphs3D.OptimizationHint.Default,
|
Graphs3D.OptimizationHint.Default,
|
||||||
"optimizationHint")
|
"optimizationHint")
|
||||||
compare(common.polar, false, "polar")
|
compare(top.common.polar, false, "polar")
|
||||||
compare(common.radialLabelOffset, 1, "radialLabelOffset")
|
compare(top.common.radialLabelOffset, 1, "radialLabelOffset")
|
||||||
compare(common.horizontalAspectRatio, 0, "horizontalAspectRatio")
|
compare(top.common.horizontalAspectRatio, 0, "horizontalAspectRatio")
|
||||||
compare(common.locale, Qt.locale("C"), "locale")
|
compare(top.common.locale, Qt.locale("C"), "locale")
|
||||||
compare(common.queriedGraphPosition, Qt.vector3d(0, 0, 0),
|
compare(top.common.queriedGraphPosition, Qt.vector3d(0, 0, 0),
|
||||||
"queriedGraphPosition")
|
"queriedGraphPosition")
|
||||||
compare(common.margin, -1, "margin")
|
compare(top.common.margin, -1, "margin")
|
||||||
compare(common.labelMargin, 0.1, "labelMargin")
|
compare(top.common.labelMargin, 0.1, "labelMargin")
|
||||||
compare(common.lightColor, "#ffffff", "lightColor")
|
compare(top.common.lightColor, "#ffffff", "lightColor")
|
||||||
compare(common.ambientLightStrength, 0.25, "ambientLightStrength")
|
compare(top.common.ambientLightStrength, 0.25, "ambientLightStrength")
|
||||||
compare(common.lightStrength, 5.0, "lightStrength")
|
compare(top.common.lightStrength, 5.0, "lightStrength")
|
||||||
compare(common.shadowStrength, 25.0, "shadowStrength")
|
compare(top.common.shadowStrength, 25.0, "shadowStrength")
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_2_change_common() {
|
function test_2_change_common() {
|
||||||
common.selectionMode = Graphs3D.SelectionFlag.None
|
top.common.selectionMode = Graphs3D.SelectionFlag.None
|
||||||
common.shadowQuality = Graphs3D.ShadowQuality.SoftHigh
|
top.common.shadowQuality = Graphs3D.ShadowQuality.SoftHigh
|
||||||
compare(common.shadowQuality,
|
compare(top.common.shadowQuality,
|
||||||
Graphs3D.ShadowQuality.SoftHigh,
|
Graphs3D.ShadowQuality.SoftHigh,
|
||||||
"shadowQuality")
|
"shadowQuality")
|
||||||
common.msaaSamples = 8
|
top.common.msaaSamples = 8
|
||||||
compare(common.msaaSamples, 8, "msaaSamples")
|
compare(top.common.msaaSamples, 8, "msaaSamples")
|
||||||
common.theme.theme = GraphsTheme.Theme.QtGreen
|
top.common.theme.theme = GraphsTheme.Theme.QtGreen
|
||||||
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
||||||
// common.renderingMode = Graphs3D.RenderingMode.DirectToBackground
|
// top.common.renderingMode = Graphs3D.RenderingMode.DirectToBackground
|
||||||
common.measureFps = true
|
top.common.measureFps = true
|
||||||
common.orthoProjection = true
|
top.common.orthoProjection = true
|
||||||
common.aspectRatio = 1.0
|
top.common.aspectRatio = 1.0
|
||||||
common.optimizationHint = Graphs3D.OptimizationHint.Default
|
top.common.optimizationHint = Graphs3D.OptimizationHint.Default
|
||||||
common.polar = true
|
top.common.polar = true
|
||||||
common.radialLabelOffset = 2
|
top.common.radialLabelOffset = 2
|
||||||
common.horizontalAspectRatio = 1
|
top.common.horizontalAspectRatio = 1
|
||||||
common.locale = Qt.locale("FI")
|
top.common.locale = Qt.locale("FI")
|
||||||
common.margin = 1.0
|
top.common.margin = 1.0
|
||||||
common.labelMargin = 1.0
|
top.common.labelMargin = 1.0
|
||||||
common.lightColor = "#ff0000"
|
top.common.lightColor = "#ff0000"
|
||||||
common.ambientLightStrength = 0.5
|
top.common.ambientLightStrength = 0.5
|
||||||
common.lightStrength = 10.0
|
top.common.lightStrength = 10.0
|
||||||
common.shadowStrength = 50.0
|
top.common.shadowStrength = 50.0
|
||||||
compare(common.selectionMode,
|
compare(top.common.selectionMode,
|
||||||
Graphs3D.SelectionFlag.None, "selectionMode")
|
Graphs3D.SelectionFlag.None, "selectionMode")
|
||||||
compare(common.shadowQuality,
|
compare(top.common.shadowQuality,
|
||||||
Graphs3D.ShadowQuality.None,
|
Graphs3D.ShadowQuality.None,
|
||||||
"shadowQuality") // Ortho disables shadows
|
"shadowQuality") // Ortho disables shadows
|
||||||
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
||||||
// compare(common.msaaSamples, 0, "msaaSamples") // Rendering mode changes this to zero
|
// compare(top.common.msaaSamples, 0, "msaaSamples") // Rendering mode changes this to zero
|
||||||
compare(common.theme.theme, GraphsTheme.Theme.QtGreen, "theme")
|
compare(top.common.theme.theme, GraphsTheme.Theme.QtGreen, "theme")
|
||||||
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
||||||
// compare(common.renderingMode, Graphs3D.RenderingMode.DirectToBackground, "renderingMode")
|
// compare(top.common.renderingMode, Graphs3D.RenderingMode.DirectToBackground, "renderingMode")
|
||||||
compare(common.measureFps, true, "measureFps")
|
compare(top.common.measureFps, true, "measureFps")
|
||||||
compare(common.orthoProjection, true, "orthoProjection")
|
compare(top.common.orthoProjection, true, "orthoProjection")
|
||||||
compare(common.aspectRatio, 1.0, "aspectRatio")
|
compare(top.common.aspectRatio, 1.0, "aspectRatio")
|
||||||
compare(common.optimizationHint,
|
compare(top.common.optimizationHint,
|
||||||
Graphs3D.OptimizationHint.Default,
|
Graphs3D.OptimizationHint.Default,
|
||||||
"optimizationHint")
|
"optimizationHint")
|
||||||
compare(common.polar, true, "polar")
|
compare(top.common.polar, true, "polar")
|
||||||
compare(common.radialLabelOffset, 2, "radialLabelOffset")
|
compare(top.common.radialLabelOffset, 2, "radialLabelOffset")
|
||||||
compare(common.horizontalAspectRatio, 1, "horizontalAspectRatio")
|
compare(top.common.horizontalAspectRatio, 1, "horizontalAspectRatio")
|
||||||
compare(common.locale, Qt.locale("FI"), "locale")
|
compare(top.common.locale, Qt.locale("FI"), "locale")
|
||||||
compare(common.margin, 1.0, "margin")
|
compare(top.common.margin, 1.0, "margin")
|
||||||
compare(common.labelMargin, 1.0, "labelMargin")
|
compare(top.common.labelMargin, 1.0, "labelMargin")
|
||||||
compare(common.lightColor, "#ff0000", "lightColor")
|
compare(top.common.lightColor, "#ff0000", "lightColor")
|
||||||
compare(common.ambientLightStrength, 0.5, "ambientLightStrength")
|
compare(top.common.ambientLightStrength, 0.5, "ambientLightStrength")
|
||||||
compare(common.lightStrength, 10.0, "lightStrength")
|
compare(top.common.lightStrength, 10.0, "lightStrength")
|
||||||
compare(common.shadowStrength, 50.0, "shadowStrength")
|
compare(top.common.shadowStrength, 50.0, "shadowStrength")
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_3_change_invalid_common() {
|
function test_3_change_invalid_common() {
|
||||||
common.selectionMode = Graphs3D.SelectionFlag.Row
|
top.common.selectionMode = Graphs3D.SelectionFlag.Row
|
||||||
| Graphs3D.SelectionFlag.Column
|
| Graphs3D.SelectionFlag.Column
|
||||||
| Graphs3D.SelectionFlag.Slice
|
| Graphs3D.SelectionFlag.Slice
|
||||||
common.theme.type = -2
|
top.common.theme.type = -2
|
||||||
common.renderingMode = -1
|
top.common.renderingMode = -1
|
||||||
common.measureFps = false
|
top.common.measureFps = false
|
||||||
common.orthoProjection = false
|
top.common.orthoProjection = false
|
||||||
common.aspectRatio = -1.0
|
top.common.aspectRatio = -1.0
|
||||||
common.polar = false
|
top.common.polar = false
|
||||||
common.horizontalAspectRatio = -2
|
top.common.horizontalAspectRatio = -2
|
||||||
compare(common.selectionMode,
|
compare(top.common.selectionMode,
|
||||||
Graphs3D.SelectionFlag.None, "selectionMode")
|
Graphs3D.SelectionFlag.None, "selectionMode")
|
||||||
compare(common.theme.type, -2 /*Theme3D.Theme.Retro*/
|
compare(top.common.theme.type, -2 /*Theme3D.Theme.Retro*/
|
||||||
, "theme") // TODO: Fix once QTRD-3367 is done
|
, "theme") // TODO: Fix once QTRD-3367 is done
|
||||||
compare(common.renderingMode,
|
compare(top.common.renderingMode,
|
||||||
-1 /*Graphs3D.RenderingMode.DirectToBackground*/
|
-1 /*Graphs3D.RenderingMode.DirectToBackground*/
|
||||||
, "renderingMode") // TODO: Fix once QTRD-3367 is done
|
, "renderingMode") // TODO: Fix once QTRD-3367 is done
|
||||||
compare(common.aspectRatio, -1.0 /*1.0*/
|
compare(top.common.aspectRatio, 1.0, "aspectRatio")
|
||||||
, "aspectRatio") // TODO: Fix once QTRD-3367 is done
|
compare(top.common.horizontalAspectRatio, 1, "horizontalAspectRatio")
|
||||||
compare(common.horizontalAspectRatio, -2 /*1*/
|
|
||||||
,
|
|
||||||
"horizontalAspectRatio") // TODO: Fix once QTRD-3367 is done
|
|
||||||
|
|
||||||
common.destroy()
|
top.common.destroy()
|
||||||
|
|
||||||
constructCommon()
|
top.constructCommon()
|
||||||
|
|
||||||
common.ambientLightStrength = -1.0
|
top.common.ambientLightStrength = -1.0
|
||||||
compare(common.ambientLightStrength, 0.25, "ambientLightStrength")
|
compare(top.common.ambientLightStrength, 0.25, "ambientLightStrength")
|
||||||
common.ambientLightStrength = -1.1
|
top.common.ambientLightStrength = -1.1
|
||||||
compare(common.ambientLightStrength, 0.25, "ambientLightStrength")
|
compare(top.common.ambientLightStrength, 0.25, "ambientLightStrength")
|
||||||
common.lightStrength = 11.0
|
top.common.lightStrength = 11.0
|
||||||
compare(common.lightStrength, 5.0, "lightStrength")
|
compare(top.common.lightStrength, 5.0, "lightStrength")
|
||||||
common.lightStrength = -1.0
|
top.common.lightStrength = -1.0
|
||||||
compare(common.lightStrength, 5.0, "lightStrength")
|
compare(top.common.lightStrength, 5.0, "lightStrength")
|
||||||
common.shadowStrength = 101.0
|
top.common.shadowStrength = 101.0
|
||||||
compare(common.shadowStrength, 25.0, "shadowStrength")
|
compare(top.common.shadowStrength, 25.0, "shadowStrength")
|
||||||
common.shadowStrength = -1.0
|
top.common.shadowStrength = -1.0
|
||||||
compare(common.shadowStrength, 25.0, "shadowStrength")
|
compare(top.common.shadowStrength, 25.0, "shadowStrength")
|
||||||
|
|
||||||
common.cameraTargetPosition = Qt.vector3d(2.0, 2.0, -2.0)
|
top.common.cameraTargetPosition = Qt.vector3d(2.0, 2.0, -2.0)
|
||||||
compare(common.cameraTargetPosition, Qt.vector3d(1.0, 1.0, -1.0),
|
compare(top.common.cameraTargetPosition, Qt.vector3d(1.0, 1.0, -1.0),
|
||||||
"cameraTargetPosition")
|
"cameraTargetPosition")
|
||||||
|
|
||||||
common.destroy()
|
top.common.destroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_4_common_initialized() {
|
function test_4_common_initialized() {
|
||||||
constructCommonInit()
|
top.constructCommonInit()
|
||||||
|
|
||||||
compare(common_init.selectionMode,
|
compare(top.common_init.selectionMode,
|
||||||
Graphs3D.SelectionFlag.None, "selectionMode")
|
Graphs3D.SelectionFlag.None, "selectionMode")
|
||||||
tryCompare(common_init, "shadowQuality",
|
tryCompare(top.common_init, "shadowQuality",
|
||||||
Graphs3D.ShadowQuality.Low)
|
Graphs3D.ShadowQuality.Low)
|
||||||
compare(common_init.msaaSamples, 2, "msaaSamples")
|
compare(top.common_init.msaaSamples, 2, "msaaSamples")
|
||||||
compare(common_init.theme.theme,
|
compare(top.common_init.theme.theme,
|
||||||
GraphsTheme.Theme.QtGreen, "theme")
|
GraphsTheme.Theme.QtGreen, "theme")
|
||||||
compare(common_init.renderingMode,
|
compare(top.common_init.renderingMode,
|
||||||
Graphs3D.RenderingMode.Indirect,
|
Graphs3D.RenderingMode.Indirect,
|
||||||
"renderingMode")
|
"renderingMode")
|
||||||
compare(common_init.measureFps, true, "measureFps")
|
compare(top.common_init.measureFps, true, "measureFps")
|
||||||
compare(common_init.customItemList.length, 0, "customItemList")
|
compare(top.common_init.customItemList.length, 0, "customItemList")
|
||||||
compare(common_init.orthoProjection, false, "orthoProjection")
|
compare(top.common_init.orthoProjection, false, "orthoProjection")
|
||||||
compare(common_init.aspectRatio, 3.0, "aspectRatio")
|
compare(top.common_init.aspectRatio, 3.0, "aspectRatio")
|
||||||
compare(common_init.optimizationHint,
|
compare(top.common_init.optimizationHint,
|
||||||
Graphs3D.OptimizationHint.Default,
|
Graphs3D.OptimizationHint.Default,
|
||||||
"optimizationHint")
|
"optimizationHint")
|
||||||
compare(common_init.polar, false, "polar")
|
compare(top.common_init.polar, false, "polar")
|
||||||
compare(common_init.radialLabelOffset, 2, "radialLabelOffset")
|
compare(top.common_init.radialLabelOffset, 2, "radialLabelOffset")
|
||||||
compare(common_init.horizontalAspectRatio, 0.2,
|
compare(top.common_init.horizontalAspectRatio, 0.2,
|
||||||
"horizontalAspectRatio")
|
"horizontalAspectRatio")
|
||||||
compare(common_init.locale, Qt.locale("UK"), "locale")
|
compare(top.common_init.locale, Qt.locale("UK"), "locale")
|
||||||
compare(common_init.margin, 0.2, "margin")
|
compare(top.common_init.margin, 0.2, "margin")
|
||||||
compare(common_init.labelMargin, 0.2, "labelMargin")
|
compare(top.common_init.labelMargin, 0.2, "labelMargin")
|
||||||
compare(common_init.lightColor, "#000000", "lightColor")
|
compare(top.common_init.lightColor, "#000000", "lightColor")
|
||||||
compare(common_init.ambientLightStrength, 0.5,
|
compare(top.common_init.ambientLightStrength, 0.5,
|
||||||
"ambientLightStrength")
|
"ambientLightStrength")
|
||||||
compare(common_init.lightStrength, 10.0, "lightStrength")
|
compare(top.common_init.lightStrength, 10.0, "lightStrength")
|
||||||
compare(common_init.shadowStrength, 50.0, "shadowStrength")
|
compare(top.common_init.shadowStrength, 50.0, "shadowStrength")
|
||||||
|
|
||||||
common_init.destroy()
|
top.common_init.destroy()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,61 +15,61 @@ Item {
|
||||||
property var common_init: null
|
property var common_init: null
|
||||||
|
|
||||||
function constructEmpty() {
|
function constructEmpty() {
|
||||||
empty = Qt.createQmlObject("
|
empty = Qt.createQmlObject(`
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtGraphs
|
import QtGraphs
|
||||||
Surface3D {
|
Surface3D {
|
||||||
}", top)
|
}`, top)
|
||||||
}
|
}
|
||||||
|
|
||||||
function constructBasic() {
|
function constructBasic() {
|
||||||
basic = Qt.createQmlObject("
|
basic = Qt.createQmlObject(`
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtGraphs
|
import QtGraphs
|
||||||
Surface3D {
|
Surface3D {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
flipHorizontalGrid: true
|
flipHorizontalGrid: true
|
||||||
}", top)
|
}`, top)
|
||||||
basic.anchors.fill = top
|
top.basic.anchors.fill = top
|
||||||
}
|
}
|
||||||
|
|
||||||
function constructCommon() {
|
function constructCommon() {
|
||||||
common = Qt.createQmlObject("
|
common = Qt.createQmlObject(`
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtGraphs
|
import QtGraphs
|
||||||
Surface3D {
|
Surface3D {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}", top)
|
}`, top)
|
||||||
common.anchors.fill = top
|
common.anchors.fill = top
|
||||||
}
|
}
|
||||||
|
|
||||||
function constructCommonInit() {
|
function constructCommonInit() {
|
||||||
common_init = Qt.createQmlObject("
|
common_init = Qt.createQmlObject(`
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtGraphs
|
import QtGraphs
|
||||||
Surface3D {
|
Surface3D {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
selectionMode: Graphs3D.SelectionFlag.None
|
selectionMode: Graphs3D.SelectionFlag.None
|
||||||
shadowQuality: Graphs3D.ShadowQuality.Low
|
shadowQuality: Graphs3D.ShadowQuality.Low
|
||||||
msaaSamples: 2
|
msaaSamples: 2
|
||||||
theme: GraphsTheme { }
|
theme: GraphsTheme { }
|
||||||
renderingMode: Graphs3D.RenderingMode.Indirect
|
renderingMode: Graphs3D.RenderingMode.Indirect
|
||||||
measureFps: true
|
measureFps: true
|
||||||
orthoProjection: false
|
orthoProjection: false
|
||||||
aspectRatio: 3.0
|
aspectRatio: 3.0
|
||||||
optimizationHint: Graphs3D.OptimizationHint.Default
|
optimizationHint: Graphs3D.OptimizationHint.Default
|
||||||
polar: false
|
polar: false
|
||||||
radialLabelOffset: 2
|
radialLabelOffset: 2
|
||||||
horizontalAspectRatio: 0.2
|
horizontalAspectRatio: 0.2
|
||||||
locale: Qt.locale(\"UK\")
|
locale: Qt.locale("UK")
|
||||||
margin: 0.2
|
margin: 0.2
|
||||||
labelMargin: 0.2
|
labelMargin: 0.2
|
||||||
lightColor: \"black\"
|
lightColor: "black"
|
||||||
ambientLightStrength: 0.5
|
ambientLightStrength: 0.5
|
||||||
lightStrength: 10.0
|
lightStrength: 10.0
|
||||||
shadowStrength: 50.0
|
shadowStrength: 50.0
|
||||||
}", top)
|
}`, top)
|
||||||
common_init.anchors.fill = top
|
top.common_init.anchors.fill = top
|
||||||
}
|
}
|
||||||
|
|
||||||
TestCase {
|
TestCase {
|
||||||
|
|
@ -77,20 +77,20 @@ shadowStrength: 50.0
|
||||||
when: windowShown
|
when: windowShown
|
||||||
|
|
||||||
function test_empty() {
|
function test_empty() {
|
||||||
constructEmpty()
|
top.constructEmpty()
|
||||||
compare(empty.width, 0, "width")
|
compare(top.empty.width, 0, "width")
|
||||||
compare(empty.height, 0, "height")
|
compare(top.empty.height, 0, "height")
|
||||||
compare(empty.seriesList.length, 0, "seriesList")
|
compare(top.empty.seriesList.length, 0, "seriesList")
|
||||||
compare(empty.selectedSeries, null, "selectedSeries")
|
compare(top.empty.selectedSeries, null, "selectedSeries")
|
||||||
compare(empty.flipHorizontalGrid, false, "flipHorizontalGrid")
|
compare(top.empty.flipHorizontalGrid, false, "flipHorizontalGrid")
|
||||||
compare(empty.axisX.orientation, Abstract3DAxis.AxisOrientation.X)
|
compare(top.empty.axisX.orientation, Abstract3DAxis.AxisOrientation.X)
|
||||||
compare(empty.axisZ.orientation, Abstract3DAxis.AxisOrientation.Z)
|
compare(top.empty.axisZ.orientation, Abstract3DAxis.AxisOrientation.Z)
|
||||||
compare(empty.axisY.orientation, Abstract3DAxis.AxisOrientation.Y)
|
compare(top.empty.axisY.orientation, Abstract3DAxis.AxisOrientation.Y)
|
||||||
compare(empty.axisX.type, Abstract3DAxis.AxisType.Value)
|
compare(top.empty.axisX.type, Abstract3DAxis.AxisType.Value)
|
||||||
compare(empty.axisZ.type, Abstract3DAxis.AxisType.Value)
|
compare(top.empty.axisZ.type, Abstract3DAxis.AxisType.Value)
|
||||||
compare(empty.axisY.type, Abstract3DAxis.AxisType.Value)
|
compare(top.empty.axisY.type, Abstract3DAxis.AxisType.Value)
|
||||||
waitForRendering(top)
|
waitForRendering(top)
|
||||||
empty.destroy()
|
top.empty.destroy()
|
||||||
waitForRendering(top)
|
waitForRendering(top)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -100,17 +100,17 @@ shadowStrength: 50.0
|
||||||
when: windowShown
|
when: windowShown
|
||||||
|
|
||||||
function test_1_basic() {
|
function test_1_basic() {
|
||||||
constructBasic()
|
top.constructBasic()
|
||||||
compare(basic.width, 150, "width")
|
compare(top.basic.width, 150, "width")
|
||||||
compare(basic.height, 150, "height")
|
compare(top.basic.height, 150, "height")
|
||||||
compare(basic.flipHorizontalGrid, true, "flipHorizontalGrid")
|
compare(top.basic.flipHorizontalGrid, true, "flipHorizontalGrid")
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_2_change_basic() {
|
function test_2_change_basic() {
|
||||||
basic.flipHorizontalGrid = false
|
top.basic.flipHorizontalGrid = false
|
||||||
compare(basic.flipHorizontalGrid, false, "flipHorizontalGrid")
|
compare(top.basic.flipHorizontalGrid, false, "flipHorizontalGrid")
|
||||||
waitForRendering(top)
|
waitForRendering(top)
|
||||||
basic.destroy()
|
top.basic.destroy()
|
||||||
waitForRendering(top)
|
waitForRendering(top)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -120,168 +120,165 @@ shadowStrength: 50.0
|
||||||
when: windowShown
|
when: windowShown
|
||||||
|
|
||||||
function test_1_common() {
|
function test_1_common() {
|
||||||
constructCommon()
|
top.constructCommon()
|
||||||
compare(common.selectionMode, Graphs3D.SelectionFlag.Item,
|
compare(top.common.selectionMode, Graphs3D.SelectionFlag.Item,
|
||||||
"selectionMode")
|
"selectionMode")
|
||||||
compare(common.shadowQuality, Graphs3D.ShadowQuality.Medium,
|
compare(top.common.shadowQuality, Graphs3D.ShadowQuality.Medium,
|
||||||
"shadowQuality")
|
"shadowQuality")
|
||||||
compare(common.msaaSamples, 4, "msaaSamples")
|
compare(top.common.msaaSamples, 4, "msaaSamples")
|
||||||
compare(common.theme.theme, GraphsTheme.Theme.QtGreen, "theme")
|
compare(top.common.theme.theme, GraphsTheme.Theme.QtGreen, "theme")
|
||||||
compare(common.renderingMode, Graphs3D.RenderingMode.Indirect,
|
compare(top.common.renderingMode, Graphs3D.RenderingMode.Indirect,
|
||||||
"renderingMode")
|
"renderingMode")
|
||||||
compare(common.measureFps, false, "measureFps")
|
compare(top.common.measureFps, false, "measureFps")
|
||||||
compare(common.customItemList.length, 0, "customItemList")
|
compare(top.common.customItemList.length, 0, "customItemList")
|
||||||
compare(common.orthoProjection, false, "orthoProjection")
|
compare(top.common.orthoProjection, false, "orthoProjection")
|
||||||
compare(common.selectedElement, Graphs3D.ElementType.None,
|
compare(top.common.selectedElement, Graphs3D.ElementType.None,
|
||||||
"selectedElement")
|
"selectedElement")
|
||||||
compare(common.aspectRatio, 2.0, "aspectRatio")
|
compare(top.common.aspectRatio, 2.0, "aspectRatio")
|
||||||
compare(common.optimizationHint, Graphs3D.OptimizationHint.Default,
|
compare(top.common.optimizationHint, Graphs3D.OptimizationHint.Default,
|
||||||
"optimizationHint")
|
"optimizationHint")
|
||||||
compare(common.polar, false, "polar")
|
compare(top.common.polar, false, "polar")
|
||||||
compare(common.radialLabelOffset, 1, "radialLabelOffset")
|
compare(top.common.radialLabelOffset, 1, "radialLabelOffset")
|
||||||
compare(common.horizontalAspectRatio, 0, "horizontalAspectRatio")
|
compare(top.common.horizontalAspectRatio, 0, "horizontalAspectRatio")
|
||||||
compare(common.locale, Qt.locale("C"), "locale")
|
compare(top.common.locale, Qt.locale("C"), "locale")
|
||||||
compare(common.queriedGraphPosition, Qt.vector3d(0, 0, 0),
|
compare(top.common.queriedGraphPosition, Qt.vector3d(0, 0, 0),
|
||||||
"queriedGraphPosition")
|
"queriedGraphPosition")
|
||||||
compare(common.margin, -1, "margin")
|
compare(top.common.margin, -1, "margin")
|
||||||
compare(common.labelMargin, 0.1, "labelMargin")
|
compare(top.common.labelMargin, 0.1, "labelMargin")
|
||||||
compare(common.lightColor, "#ffffff", "lightColor")
|
compare(top.common.lightColor, "#ffffff", "lightColor")
|
||||||
compare(common.ambientLightStrength, 0.25, "ambientLightStrength")
|
compare(top.common.ambientLightStrength, 0.25, "ambientLightStrength")
|
||||||
compare(common.lightStrength, 5.0, "lightStrength")
|
compare(top.common.lightStrength, 5.0, "lightStrength")
|
||||||
compare(common.shadowStrength, 25.0, "shadowStrength")
|
compare(top.common.shadowStrength, 25.0, "shadowStrength")
|
||||||
|
|
||||||
common.destroy()
|
top.common.destroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_2_change_common() {
|
function test_2_change_common() {
|
||||||
constructCommon()
|
top.constructCommon()
|
||||||
common.selectionMode = Graphs3D.SelectionFlag.Item
|
top.common.selectionMode = Graphs3D.SelectionFlag.Item
|
||||||
| Graphs3D.SelectionFlag.Row | Graphs3D.SelectionFlag.Slice
|
| Graphs3D.SelectionFlag.Row | Graphs3D.SelectionFlag.Slice
|
||||||
common.shadowQuality = Graphs3D.ShadowQuality.SoftHigh
|
top.common.shadowQuality = Graphs3D.ShadowQuality.SoftHigh
|
||||||
compare(common.shadowQuality, Graphs3D.ShadowQuality.SoftHigh,
|
compare(top.common.shadowQuality, Graphs3D.ShadowQuality.SoftHigh,
|
||||||
"shadowQuality")
|
"shadowQuality")
|
||||||
common.msaaSamples = 8
|
top.common.msaaSamples = 8
|
||||||
compare(common.msaaSamples, 8, "msaaSamples")
|
compare(top.common.msaaSamples, 8, "msaaSamples")
|
||||||
common.theme.theme = GraphsTheme.Theme.QtGreen
|
top.common.theme.theme = GraphsTheme.Theme.QtGreen
|
||||||
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
||||||
// common.renderingMode = Graphs3D.RenderingMode.DirectToBackground
|
// top.common.renderingMode = Graphs3D.RenderingMode.DirectToBackground
|
||||||
common.measureFps = true
|
top.common.measureFps = true
|
||||||
common.orthoProjection = true
|
top.common.orthoProjection = true
|
||||||
common.aspectRatio = 1.0
|
top.common.aspectRatio = 1.0
|
||||||
common.optimizationHint = Graphs3D.OptimizationHint.Default
|
top.common.optimizationHint = Graphs3D.OptimizationHint.Default
|
||||||
common.polar = true
|
top.common.polar = true
|
||||||
common.radialLabelOffset = 2
|
top.common.radialLabelOffset = 2
|
||||||
common.horizontalAspectRatio = 1
|
top.common.horizontalAspectRatio = 1
|
||||||
common.locale = Qt.locale("FI")
|
top.common.locale = Qt.locale("FI")
|
||||||
common.margin = 1.0
|
top.common.margin = 1.0
|
||||||
common.labelMargin = 1.0
|
top.common.labelMargin = 1.0
|
||||||
common.lightColor = "#ff0000"
|
top.common.lightColor = "#ff0000"
|
||||||
common.ambientLightStrength = 0.5
|
top.common.ambientLightStrength = 0.5
|
||||||
common.lightStrength = 10.0
|
top.common.lightStrength = 10.0
|
||||||
common.shadowStrength = 50.0
|
top.common.shadowStrength = 50.0
|
||||||
compare(common.selectionMode,
|
compare(top.common.selectionMode,
|
||||||
Graphs3D.SelectionFlag.Item | Graphs3D.SelectionFlag.Row
|
Graphs3D.SelectionFlag.Item | Graphs3D.SelectionFlag.Row
|
||||||
| Graphs3D.SelectionFlag.Slice, "selectionMode")
|
| Graphs3D.SelectionFlag.Slice, "selectionMode")
|
||||||
compare(common.shadowQuality, Graphs3D.ShadowQuality.None,
|
compare(top.common.shadowQuality, Graphs3D.ShadowQuality.None,
|
||||||
"shadowQuality") // Ortho disables shadows
|
"shadowQuality") // Ortho disables shadows
|
||||||
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
||||||
// compare(common.msaaSamples, 0, "msaaSamples") // Rendering mode changes this to zero
|
// compare(top.common.msaaSamples, 0, "msaaSamples") // Rendering mode changes this to zero
|
||||||
compare(common.theme.theme, GraphsTheme.Theme.QtGreen, "theme")
|
compare(top.common.theme.theme, GraphsTheme.Theme.QtGreen, "theme")
|
||||||
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
// TODO: Seems to be causing crashes in testing - QTBUG-122089
|
||||||
// compare(common.renderingMode, Graphs3D.RenderingMode.DirectToBackground, "renderingMode")
|
// compare(top.common.renderingMode, Graphs3D.RenderingMode.DirectToBackground, "renderingMode")
|
||||||
compare(common.measureFps, true, "measureFps")
|
compare(top.common.measureFps, true, "measureFps")
|
||||||
compare(common.orthoProjection, true, "orthoProjection")
|
compare(top.common.orthoProjection, true, "orthoProjection")
|
||||||
compare(common.aspectRatio, 1.0, "aspectRatio")
|
compare(top.common.aspectRatio, 1.0, "aspectRatio")
|
||||||
compare(common.optimizationHint, Graphs3D.OptimizationHint.Default,
|
compare(top.common.optimizationHint, Graphs3D.OptimizationHint.Default,
|
||||||
"optimizationHint")
|
"optimizationHint")
|
||||||
compare(common.polar, true, "polar")
|
compare(top.common.polar, true, "polar")
|
||||||
compare(common.radialLabelOffset, 2, "radialLabelOffset")
|
compare(top.common.radialLabelOffset, 2, "radialLabelOffset")
|
||||||
compare(common.horizontalAspectRatio, 1, "horizontalAspectRatio")
|
compare(top.common.horizontalAspectRatio, 1, "horizontalAspectRatio")
|
||||||
compare(common.locale, Qt.locale("FI"), "locale")
|
compare(top.common.locale, Qt.locale("FI"), "locale")
|
||||||
compare(common.margin, 1.0, "margin")
|
compare(top.common.margin, 1.0, "margin")
|
||||||
compare(common.labelMargin, 1.0, "labelMargin")
|
compare(top.common.labelMargin, 1.0, "labelMargin")
|
||||||
compare(common.lightColor, "#ff0000", "lightColor")
|
compare(top.common.lightColor, "#ff0000", "lightColor")
|
||||||
compare(common.ambientLightStrength, 0.5, "ambientLightStrength")
|
compare(top.common.ambientLightStrength, 0.5, "ambientLightStrength")
|
||||||
compare(common.lightStrength, 10.0, "lightStrength")
|
compare(top.common.lightStrength, 10.0, "lightStrength")
|
||||||
compare(common.shadowStrength, 50.0, "shadowStrength")
|
compare(top.common.shadowStrength, 50.0, "shadowStrength")
|
||||||
|
|
||||||
common.destroy()
|
top.common.destroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_3_change_invalid_common() {
|
function test_3_change_invalid_common() {
|
||||||
constructCommon()
|
top.constructCommon()
|
||||||
common.selectionMode = Graphs3D.SelectionFlag.Row
|
top.common.selectionMode = Graphs3D.SelectionFlag.Row
|
||||||
| Graphs3D.SelectionFlag.Column | Graphs3D.SelectionFlag.Slice
|
| Graphs3D.SelectionFlag.Column | Graphs3D.SelectionFlag.Slice
|
||||||
common.theme.type = -2
|
top.common.theme.type = -2
|
||||||
common.renderingMode = -1
|
top.common.renderingMode = -1
|
||||||
common.measureFps = false
|
top.common.measureFps = false
|
||||||
common.orthoProjection = false
|
top.common.orthoProjection = false
|
||||||
common.aspectRatio = -1.0
|
top.common.aspectRatio = -1.0
|
||||||
common.polar = false
|
top.common.polar = false
|
||||||
common.horizontalAspectRatio = -2
|
top.common.horizontalAspectRatio = -2
|
||||||
compare(common.selectionMode, Graphs3D.SelectionFlag.Item,
|
compare(top.common.selectionMode, Graphs3D.SelectionFlag.Item,
|
||||||
"selectionMode")
|
"selectionMode")
|
||||||
compare(common.theme.type, -2 /*Theme3D.Theme.Retro*/
|
compare(top.common.theme.type, -2 /*Theme3D.Theme.Retro*/
|
||||||
, "theme") // TODO: Fix once QTRD-3367 is done
|
, "theme") // TODO: Fix once QTRD-3367 is done
|
||||||
compare(common.renderingMode,
|
compare(top.common.renderingMode,
|
||||||
-1 /*Graphs3D.RenderingMode.DirectToBackground*/
|
-1 /*Graphs3D.RenderingMode.DirectToBackground*/
|
||||||
, "renderingMode") // TODO: Fix once QTRD-3367 is done
|
, "renderingMode") // TODO: Fix once QTRD-3367 is done
|
||||||
compare(common.aspectRatio, -1.0 /*1.0*/
|
compare(top.common.aspectRatio, 2.0, "aspectRatio")
|
||||||
, "aspectRatio") // TODO: Fix once QTRD-3367 is done
|
compare(top.common.horizontalAspectRatio, 0, "horizontalAspectRatio")
|
||||||
compare(common.horizontalAspectRatio, -2 /*1*/
|
|
||||||
,
|
|
||||||
"horizontalAspectRatio") // TODO: Fix once QTRD-3367 is done
|
|
||||||
|
|
||||||
common.ambientLightStrength = -1.0
|
top.common.ambientLightStrength = -1.0
|
||||||
compare(common.ambientLightStrength, 0.25, "ambientLightStrength")
|
compare(top.common.ambientLightStrength, 0.25, "ambientLightStrength")
|
||||||
common.ambientLightStrength = -1.1
|
top.common.ambientLightStrength = -1.1
|
||||||
compare(common.ambientLightStrength, 0.25, "ambientLightStrength")
|
compare(top.common.ambientLightStrength, 0.25, "ambientLightStrength")
|
||||||
common.lightStrength = 11.0
|
top.common.lightStrength = 11.0
|
||||||
compare(common.lightStrength, 5.0, "lightStrength")
|
compare(top.common.lightStrength, 5.0, "lightStrength")
|
||||||
common.lightStrength = -1.0
|
top.common.lightStrength = -1.0
|
||||||
compare(common.lightStrength, 5.0, "lightStrength")
|
compare(top.common.lightStrength, 5.0, "lightStrength")
|
||||||
common.shadowStrength = 101.0
|
top.common.shadowStrength = 101.0
|
||||||
compare(common.shadowStrength, 25.0, "shadowStrength")
|
compare(top.common.shadowStrength, 25.0, "shadowStrength")
|
||||||
common.shadowStrength = -1.0
|
top.common.shadowStrength = -1.0
|
||||||
compare(common.shadowStrength, 25.0, "shadowStrength")
|
compare(top.common.shadowStrength, 25.0, "shadowStrength")
|
||||||
common.cameraTargetPosition = Qt.vector3d(2.0, 2.0, -2.0)
|
top.common.cameraTargetPosition = Qt.vector3d(2.0, 2.0, -2.0)
|
||||||
compare(common.cameraTargetPosition, Qt.vector3d(1.0, 1.0, -1.0),
|
compare(top.common.cameraTargetPosition, Qt.vector3d(1.0, 1.0, -1.0),
|
||||||
"cameraTargetPosition")
|
"cameraTargetPosition")
|
||||||
|
|
||||||
common.destroy()
|
top.common.destroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_4_common_initialized() {
|
function test_4_common_initialized() {
|
||||||
constructCommonInit()
|
constructCommonInit()
|
||||||
|
|
||||||
compare(common_init.selectionMode, Graphs3D.SelectionFlag.None,
|
compare(top.common_init.selectionMode, Graphs3D.SelectionFlag.None,
|
||||||
"selectionMode")
|
"selectionMode")
|
||||||
tryCompare(common_init, "shadowQuality", Graphs3D.ShadowQuality.Low)
|
tryCompare(common_init, "shadowQuality", Graphs3D.ShadowQuality.Low)
|
||||||
compare(common_init.msaaSamples, 2, "msaaSamples")
|
compare(top.common_init.msaaSamples, 2, "msaaSamples")
|
||||||
compare(common_init.theme.theme,
|
compare(top.common_init.theme.theme,
|
||||||
GraphsTheme.Theme.QtGreen, "theme")
|
GraphsTheme.Theme.QtGreen, "theme")
|
||||||
compare(common_init.renderingMode, Graphs3D.RenderingMode.Indirect,
|
compare(top.common_init.renderingMode, Graphs3D.RenderingMode.Indirect,
|
||||||
"renderingMode")
|
"renderingMode")
|
||||||
compare(common_init.measureFps, true, "measureFps")
|
compare(top.common_init.measureFps, true, "measureFps")
|
||||||
compare(common_init.customItemList.length, 0, "customItemList")
|
compare(top.common_init.customItemList.length, 0, "customItemList")
|
||||||
compare(common_init.orthoProjection, false, "orthoProjection")
|
compare(top.common_init.orthoProjection, false, "orthoProjection")
|
||||||
compare(common_init.aspectRatio, 3.0, "aspectRatio")
|
compare(top.common_init.aspectRatio, 3.0, "aspectRatio")
|
||||||
compare(common_init.optimizationHint,
|
compare(top.common_init.optimizationHint,
|
||||||
Graphs3D.OptimizationHint.Default, "optimizationHint")
|
Graphs3D.OptimizationHint.Default, "optimizationHint")
|
||||||
compare(common_init.polar, false, "polar")
|
compare(top.common_init.polar, false, "polar")
|
||||||
compare(common_init.radialLabelOffset, 2, "radialLabelOffset")
|
compare(top.common_init.radialLabelOffset, 2, "radialLabelOffset")
|
||||||
compare(common_init.horizontalAspectRatio, 0.2,
|
compare(top.common_init.horizontalAspectRatio, 0.2,
|
||||||
"horizontalAspectRatio")
|
"horizontalAspectRatio")
|
||||||
compare(common_init.locale, Qt.locale("UK"), "locale")
|
compare(top.common_init.locale, Qt.locale("UK"), "locale")
|
||||||
compare(common_init.margin, 0.2, "margin")
|
compare(top.common_init.margin, 0.2, "margin")
|
||||||
compare(common_init.labelMargin, 0.2, "labelMargin")
|
compare(top.common_init.labelMargin, 0.2, "labelMargin")
|
||||||
compare(common_init.lightColor, "#000000", "lightColor")
|
compare(top.common_init.lightColor, "#000000", "lightColor")
|
||||||
compare(common_init.ambientLightStrength, 0.5,
|
compare(top.common_init.ambientLightStrength, 0.5,
|
||||||
"ambientLightStrength")
|
"ambientLightStrength")
|
||||||
compare(common_init.lightStrength, 10.0, "lightStrength")
|
compare(top.common_init.lightStrength, 10.0, "lightStrength")
|
||||||
compare(common_init.shadowStrength, 50.0, "shadowStrength")
|
compare(top.common_init.shadowStrength, 50.0, "shadowStrength")
|
||||||
|
|
||||||
common_init.destroy()
|
top.common_init.destroy()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue