##// END OF EJS Templates
Added isZoomed method to ChartView...
Added isZoomed method to ChartView isZoomed() method added also the the QML side. Change-Id: Ic0e878bb383316f37a4136d4b920849f1f1853ef Task-number: QTRD-3667 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>

File last commit:

r2804:97642714ab1e
r2813:643291cd617f
Show More
tst_chartview.qml
80 lines | 4.2 KiB | application/x-qml | QmlLexer
Tero Ahola
Unit test module for QML API
r2206 /****************************************************************************
**
Titta Heikkala
Copyright header changes...
r2776 ** Copyright (C) 2015 The Qt Company Ltd
Tero Ahola
Unit test module for QML API
r2206 ** All rights reserved.
Titta Heikkala
Copyright header changes...
r2776 ** For any questions to The Qt Company, please use contact form at http://qt.io
Tero Ahola
Unit test module for QML API
r2206 **
Titta Heikkala
Updated license headers...
r2740 ** This file is part of the Qt Charts module.
Tero Ahola
Unit test module for QML API
r2206 **
Titta Heikkala
Updated license headers...
r2740 ** Licensees holding valid commercial license for Qt may use this file in
** accordance with the Qt License Agreement provided with the Software
** or, alternatively, in accordance with the terms contained in a written
Titta Heikkala
Copyright header changes...
r2776 ** agreement between you and The Qt Company.
Tero Ahola
Unit test module for QML API
r2206 **
** If you have questions regarding the use of this file, please use
Titta Heikkala
Updated license headers...
r2740 ** contact form at http://qt.io
Tero Ahola
Unit test module for QML API
r2206 **
****************************************************************************/
Titta Heikkala
Fix Charts QML api auto test...
r2638 import QtQuick 2.0
import QtTest 1.0
Titta Heikkala
Qt Charts project file structure change...
r2712 import QtCharts 2.0
Tero Ahola
Unit test module for QML API
r2206
Rectangle {
width: 400
height: 300
TestCase {
id: tc1
Tero Ahola
Renamed QML QtQuick tests to match the naming convention
r2228 name: "tst_qml-qtquicktest ChartView Properties"
Tero Ahola
Unit test module for QML API
r2206 when: windowShown
function test_chartViewProperties() {
compare(chartView.animationOptions, ChartView.NoAnimation, "ChartView.animationOptions");
Titta Heikkala
Added possibility to set duration and easing curve for chart animation...
r2804 compare(chartView.animationDuration, 1000, "ChartView.animationDuration");
compare(chartView.animationEasingCurve.type, Easing.OutQuart, "ChartView.animationEasingCurve");
Tero Ahola
Unit test module for QML API
r2206 verify(chartView.backgroundColor != undefined);
Tero Ahola
Improved QML API test coverage
r2243 verify(chartView.margins.bottom > 0, "ChartView.margins.bottom");
verify(chartView.margins.top > 0, "ChartView.margins.top");
verify(chartView.margins.left > 0, "ChartView.margins.left");
verify(chartView.margins.right > 0, "ChartView.margins.right");
Tero Ahola
Unit test module for QML API
r2206 compare(chartView.count, 0, "ChartView.count");
compare(chartView.dropShadowEnabled, false, "ChartView.dropShadowEnabled");
verify(chartView.plotArea.height > 0, "ChartView.plotArea.height");
verify(chartView.plotArea.width > 0, "ChartView.plotArea.width");
verify(chartView.plotArea.x > 0, "ChartView.plotArea.x");
verify(chartView.plotArea.y > 0, "ChartView.plotArea.y");
compare(chartView.theme, ChartView.ChartThemeLight, "ChartView.theme");
compare(chartView.title, "", "ChartView.title");
compare(chartView.title, "", "ChartView.title");
verify(chartView.titleColor != undefined, "ChartView.titleColor");
compare(chartView.titleFont.bold, false, "ChartView.titleFont.bold");
// Legend
compare(chartView.legend.visible, true, "ChartView.legend.visible");
compare(chartView.legend.alignment, Qt.AlignTop, "ChartView.legend.alignment");
compare(chartView.legend.backgroundVisible, false, "ChartView.legend.backgroundVisible");
verify(chartView.legend.borderColor != undefined, "ChartView.legend.borderColor");
verify(chartView.legend.color != undefined, "ChartView.legend.color");
Titta Heikkala
Add possibility to set markers in legend in reverse order...
r2676 compare(chartView.legend.reverseMarkers, false, "ChartView.legend.reverseMarkers");
Tero Ahola
Unit test module for QML API
r2206 // Legend font
compare(chartView.legend.font.bold, false, "ChartView.legend.font.bold");
compare(chartView.legend.font.capitalization, Font.MixedCase, "ChartView.legend.font.capitalization");
Tero Ahola
Fixed a bug in ChartView.axes property when no series added
r2300 verify(chartView.legend.font.family != "", "ChartView.legend.font.family");
Tero Ahola
Unit test module for QML API
r2206 compare(chartView.legend.font.italic, false, "ChartView.legend.font.italic");
compare(chartView.legend.font.letterSpacing, 0.0, "ChartView.legend.font.letterSpacing");
verify(chartView.legend.font.pixelSize > 0
&& chartView.legend.font.pixelSize < 50, "ChartView.legend.font.pixelSize");
verify(chartView.legend.font.pointSize > 0
&& chartView.legend.font.pointSize < 50, "ChartView.legend.font.pointSize");
compare(chartView.legend.font.strikeout, false, "ChartView.legend.font.strikeout");
compare(chartView.legend.font.underline, false, "ChartView.legend.font.underline");
compare(chartView.legend.font.weight, Font.Normal, "ChartView.legend.font.weight");
compare(chartView.legend.font.wordSpacing, 0.0, "ChartView.legend.font.wordSpacing");
}
}
ChartView {
id: chartView
anchors.fill: parent
}
}