@@ -28,24 +28,27 @@ Rectangle {
29 property var widgetDataComplete: {
29 property var widgetDataComplete: {
30 "title": "Title here longa long long long long long long long long long long",
30 "title": "Title here longa long long long long long long long long long long",
31− "values": [ [ "Long Label 1", "Value 1"], [ "Label 2", "Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2"], [ "Label 3", "Value 3"], [ "Label 4", "Value 4"], [ "Label 5", "Value 5"] ]
31+ "values": [ [ "Long Label 1", "Long Value 1 Long Value 2 Long Value 3 Long Value 4 Long Value 5 Long Value 6 Long Value 2 Long Value 2 Long Value 2 Long Value 2"], [ "Label 2", "Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2"], [ "Label 3", "Value 3"], [ "Label 4", "Value 4"], [ "Label 5", "Value 5"] ]
34 property var widgetDataNoTitle: {
34 property var widgetDataNoTitle: {
35− "values": [ [ "Long Label 1", "Value 1"], [ "Label 2", "Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2"], [ "Label 3", "Value 3"], [ "Label 4", "Value 4"], [ "Label 5", "Value 5"] ]
35+ "values": [ [ "Long Label 1", "Long Value 1 Long Value 2 Long Value 3 Long Value 4 Long Value 5 Long Value 6 Long Value 2 Long Value 2 Long Value 2 Long Value 2"], [ "Label 2", "Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2"], [ "Label 3", "Value 3"], [ "Label 4", "Value 4"], [ "Label 5", "Value 5"] ]
38 PreviewWidgetFactory {
38 PreviewWidgetFactory {
39 id: previewTable
39 id: previewTable
40 anchors { left: parent.left; right: parent.right }
40 anchors { left: parent.left; right: parent.right }
41 widgetType: "table"
41 widgetType: "table"
42− widgetData: widgetDataComplete
44 Rectangle {
43 Rectangle {
45 color: "red"
44 color: "red"
46 anchors.fill: parent
45 anchors.fill: parent
47 opacity: 0.5
46 opacity: 0.5
49+ Component.onCompleted: {
50+ previewTable.widgetData = widgetDataComplete
51 UT.UnityTestCase {
54 UT.UnityTestCase {
@@ -56,9 +59,17 @@ Rectangle {
56 previewTable.widgetData = widgetDataComplete;
59 previewTable.widgetData = widgetDataComplete;
62+ function test_label_heights() {
63+ verify(findChild(previewTable, "label00").height == findChild(previewTable, "label10").height);
64+ verify(findChild(previewTable, "label01").height == findChild(previewTable, "label11").height);
65+ verify(findChild(previewTable, "label01").height > findChild(previewTable, "label00").height * 3);
66+ verify(findChild(previewTable, "label00").height == findChild(previewTable, "label20").height);
67+ verify(findChild(previewTable, "label20").height == findChild(previewTable, "label21").height);
59 function test_values() {
70 function test_values() {
60 compare(findChild(previewTable, "label00").text, "Long Label 1");
71 compare(findChild(previewTable, "label00").text, "Long Label 1");
61− compare(findChild(previewTable, "label01").text, "Value 1");
72+ compare(findChild(previewTable, "label01").text, "Long Value 1 Long Value 2 Long Value 3 Long Value 4 Long Value 5 Long Value 6 Long Value 2 Long Value 2 Long Value 2 Long Value 2");
62 compare(findChild(previewTable, "label10").text, "Label 2");
73 compare(findChild(previewTable, "label10").text, "Label 2");
63 compare(findChild(previewTable, "label11").text, "Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2");
74 compare(findChild(previewTable, "label11").text, "Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2");
64 compare(findChild(previewTable, "label20").text, "Label 3");
75 compare(findChild(previewTable, "label20").text, "Label 3");