Debian Codegraph @

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