Debian Codegraph @

tests/auto/qml-qtquicktest/data/tst_chartview_2_0.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 2.0"
15 when: windowShown
16
17 function test_chartViewProperties() {
18 compare(chartView.animationOptions, ChartView.NoAnimation, "ChartView.animationOptions");
19 verify(chartView.backgroundColor != undefined);
20 verify(chartView.margins.bottom > 0, "ChartView.margins.bottom");
21 verify(chartView.margins.top > 0, "ChartView.margins.top");
22 verify(chartView.margins.left > 0, "ChartView.margins.left");
23 verify(chartView.margins.right > 0, "ChartView.margins.right");
24 compare(chartView.count, 0, "ChartView.count");
25 compare(chartView.dropShadowEnabled, false, "ChartView.dropShadowEnabled");
26 verify(chartView.plotArea.height > 0, "ChartView.plotArea.height");
27 verify(chartView.plotArea.width > 0, "ChartView.plotArea.width");
28 verify(chartView.plotArea.x > 0, "ChartView.plotArea.x");
29 verify(chartView.plotArea.y > 0, "ChartView.plotArea.y");
30 compare(chartView.theme, ChartView.ChartThemeLight, "ChartView.theme");
31 compare(chartView.title, "", "ChartView.title");
32 compare(chartView.title, "", "ChartView.title");
33 verify(chartView.titleColor != undefined, "ChartView.titleColor");
34 compare(chartView.titleFont.bold, false, "ChartView.titleFont.bold");
35 // Legend
36 compare(chartView.legend.visible, true, "ChartView.legend.visible");
37 compare(chartView.legend.alignment, Qt.AlignTop, "ChartView.legend.alignment");
38 compare(chartView.legend.backgroundVisible, false, "ChartView.legend.backgroundVisible");
39 verify(chartView.legend.borderColor != undefined, "ChartView.legend.borderColor");
40 verify(chartView.legend.color != undefined, "ChartView.legend.color");
41 compare(chartView.legend.reverseMarkers, false, "ChartView.legend.reverseMarkers");
42 // Legend font
43 compare(chartView.legend.font.bold, false, "ChartView.legend.font.bold");
44 compare(chartView.legend.font.capitalization, Font.MixedCase, "ChartView.legend.font.capitalization");
45 verify(chartView.legend.font.family != "", "ChartView.legend.font.family");
46 compare(chartView.legend.font.italic, false, "ChartView.legend.font.italic");
47 compare(chartView.legend.font.letterSpacing, 0.0, "ChartView.legend.font.letterSpacing");
48 verify(chartView.legend.font.pixelSize > 0
49 && chartView.legend.font.pixelSize < 50, "ChartView.legend.font.pixelSize");
50 verify(chartView.legend.font.pointSize > 0
51 && chartView.legend.font.pointSize < 50, "ChartView.legend.font.pointSize");
52 compare(chartView.legend.font.strikeout, false, "ChartView.legend.font.strikeout");
53 compare(chartView.legend.font.underline, false, "ChartView.legend.font.underline");
54 compare(chartView.legend.font.weight, Font.Normal, "ChartView.legend.font.weight");
55 compare(chartView.legend.font.wordSpacing, 0.0, "ChartView.legend.font.wordSpacing");
56 }
57 }
58
59 ChartView {
60 id: chartView
61 anchors.fill: parent
62 }
63 }