Debian Codegraph @

tests/auto/qml-qtquicktest/data/tst_chartview.qml

raw
1 // Copyright (C) 2016 The Qt Company Ltd.
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4 import QtQuick 2.0
5 import QtTest 1.0
6 import QtCharts 2.0
7
8 Rectangle {
9 width: 400
10 height: 300
11
12 TestCase {
13 id: tc1
14 name: "tst_qml-qtquicktest ChartView Properties"
15 when: windowShown
16
17 function test_chartViewProperties() {
18 compare(chartView.animationOptions, ChartView.NoAnimation, "ChartView.animationOptions");
19 compare(chartView.animationDuration, 1000, "ChartView.animationDuration");
20 compare(chartView.animationEasingCurve.type, Easing.OutQuart, "ChartView.animationEasingCurve");
21 verify(chartView.backgroundColor != undefined);
22 verify(chartView.margins.bottom > 0, "ChartView.margins.bottom");
23 verify(chartView.margins.top > 0, "ChartView.margins.top");
24 verify(chartView.margins.left > 0, "ChartView.margins.left");
25 verify(chartView.margins.right > 0, "ChartView.margins.right");
26 compare(chartView.count, 0, "ChartView.count");
27 compare(chartView.dropShadowEnabled, false, "ChartView.dropShadowEnabled");
28 verify(chartView.plotArea.height > 0, "ChartView.plotArea.height");
29 verify(chartView.plotArea.width > 0, "ChartView.plotArea.width");
30 verify(chartView.plotArea.x > 0, "ChartView.plotArea.x");
31 verify(chartView.plotArea.y > 0, "ChartView.plotArea.y");
32 compare(chartView.theme, ChartView.ChartThemeLight, "ChartView.theme");
33 compare(chartView.title, "", "ChartView.title");
34 compare(chartView.title, "", "ChartView.title");
35 verify(chartView.titleColor != undefined, "ChartView.titleColor");
36 compare(chartView.titleFont.bold, false, "ChartView.titleFont.bold");
37 // Legend
38 compare(chartView.legend.visible, true, "ChartView.legend.visible");
39 compare(chartView.legend.alignment, Qt.AlignTop, "ChartView.legend.alignment");
40 compare(chartView.legend.backgroundVisible, false, "ChartView.legend.backgroundVisible");
41 verify(chartView.legend.borderColor != undefined, "ChartView.legend.borderColor");
42 verify(chartView.legend.color != undefined, "ChartView.legend.color");
43 compare(chartView.legend.reverseMarkers, false, "ChartView.legend.reverseMarkers");
44 // Legend font
45 compare(chartView.legend.font.bold, false, "ChartView.legend.font.bold");
46 compare(chartView.legend.font.capitalization, Font.MixedCase, "ChartView.legend.font.capitalization");
47 verify(chartView.legend.font.family != "", "ChartView.legend.font.family");
48 compare(chartView.legend.font.italic, false, "ChartView.legend.font.italic");
49 compare(chartView.legend.font.letterSpacing, 0.0, "ChartView.legend.font.letterSpacing");
50 verify(chartView.legend.font.pixelSize > 0
51 && chartView.legend.font.pixelSize < 50, "ChartView.legend.font.pixelSize");
52 verify(chartView.legend.font.pointSize > 0
53 && chartView.legend.font.pointSize < 50, "ChartView.legend.font.pointSize");
54 compare(chartView.legend.font.strikeout, false, "ChartView.legend.font.strikeout");
55 compare(chartView.legend.font.underline, false, "ChartView.legend.font.underline");
56 compare(chartView.legend.font.weight, Font.Normal, "ChartView.legend.font.weight");
57 compare(chartView.legend.font.wordSpacing, 0.0, "ChartView.legend.font.wordSpacing");
58 }
59 }
60
61 ChartView {
62 id: chartView
63 anchors.fill: parent
64 }
65 }