on xenial help sign in
No need to use components in card creator generated code
3ae55a4Albert Astals Cid
plugins/Dash/CardCreator.js+14−9
@@ -61,7 +61,9 @@ var kBackgroundLoaderCode = 'Loader {\n\
61// %1 is used as anchors of artShapeHolder
61// %1 is used as anchors of artShapeHolder
62// %2 is used as image width
62// %2 is used as image width
63// %3 is used as image height
63// %3 is used as image height
64+// %4 is used as aspect ratio fallback
65+// %5 is used for artShapeSource.hideSource and inner Loader visible
64−// %4 is injected as code to artImage
66+// %6 is injected as code to artImage
65var kArtShapeHolderCode = 'Item { \n\
67var kArtShapeHolderCode = 'Item { \n\
66 id: artShapeHolder; \n\
68 id: artShapeHolder; \n\
67 height: root.fixedArtShapeSize.height > 0 ? root.fixedArtShapeSize.height : artShapeLoader.height; \n\
69 height: root.fixedArtShapeSize.height > 0 ? root.fixedArtShapeSize.height : artShapeLoader.height; \n\
@@ -76,7 +78,6 @@ var kArtShapeHolderCode = 'Item { \n\
76 sourceComponent: Item { \n\
78 sourceComponent: Item { \n\
77 id: artShape; \n\
79 id: artShape; \n\
78 objectName: "artShape"; \n\
80 objectName: "artShape"; \n\
79− readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true; \n\
80 visible: image.status == Image.Ready; \n\
81 visible: image.status == Image.Ready; \n\
81 readonly property alias image: artImage; \n\
82 readonly property alias image: artImage; \n\
82 ShaderEffectSource { \n\
83 ShaderEffectSource { \n\
@@ -85,11 +86,11 @@ var kArtShapeHolderCode = 'Item { \n\
85 anchors.centerIn: parent; \n\
86 anchors.centerIn: parent; \n\
86 width: 1; \n\
87 width: 1; \n\
87 height: 1; \n\
88 height: 1; \n\
88− hideSource: doShapeItem; \n\
89+ hideSource: %5; \n\
89 } \n\
90 } \n\
90 Loader { \n\
91 Loader { \n\
91 anchors.fill: parent; \n\
92 anchors.fill: parent; \n\
92− visible: artShape.doShapeItem; \n\
93+ visible: %5; \n\
93 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent; \n\
94 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent; \n\
94 Component { \n\
95 Component { \n\
95 id: artShapeShapeComponent; \n\
96 id: artShapeShapeComponent; \n\
@@ -113,7 +114,7 @@ var kArtShapeHolderCode = 'Item { \n\
113 } \n\
114 } \n\
114 } \n\
115 } \n\
115 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\
116 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\
116− readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; \n\
117+ readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : %4; \n\
117 Component.onCompleted: { updateWidthHeightBindings(); } \n\
118 Component.onCompleted: { updateWidthHeightBindings(); } \n\
118 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } \n\
119 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } \n\
119 function updateWidthHeightBindings() { \n\
120 function updateWidthHeightBindings() { \n\
@@ -132,7 +133,7 @@ var kArtShapeHolderCode = 'Item { \n\
132 asynchronous: root.asynchronous; \n\
133 asynchronous: root.asynchronous; \n\
133 width: %2; \n\
134 width: %2; \n\
134 height: %3; \n\
135 height: %3; \n\
135− %4 \n\
136+ %6 \n\
136 } \n\
137 } \n\
137 } \n\
138 } \n\
138 } \n\
139 } \n\
@@ -398,7 +399,6 @@ function cardString(template, components) {
398
399
399 code = 'AbstractButton { \n\
400 code = 'AbstractButton { \n\
400 id: root; \n\
401 id: root; \n\
401− property var components; \n\
402 property var cardData; \n\
402 property var cardData; \n\
403 property string artShapeStyle: "inset"; \n\
403 property string artShapeStyle: "inset"; \n\
404 property string backgroundShapeStyle: "inset"; \n\
404 property string backgroundShapeStyle: "inset"; \n\
@@ -416,7 +416,8 @@ function cardString(template, components) {
416
416
417 var hasArt = components["art"] && components["art"]["field"] || false;
417 var hasArt = components["art"] && components["art"]["field"] || false;
418 var hasSummary = components["summary"] || false;
418 var hasSummary = components["summary"] || false;
419+ var isConciergeMode = components["art"] && components["art"]["conciergeMode"] || false;
419− var artAndSummary = hasArt && hasSummary && components["art"]["conciergeMode"] !== true;
420+ var artAndSummary = hasArt && hasSummary && !isConciergeMode;
420 var isHorizontal = template["card-layout"] === "horizontal";
421 var isHorizontal = template["card-layout"] === "horizontal";
421 var hasBackground = (!isHorizontal && (template["card-background"] || components["background"] || artAndSummary)) ||
422 var hasBackground = (!isHorizontal && (template["card-background"] || components["background"] || artAndSummary)) ||
422 (hasSummary && (template["card-background"] || components["background"]));
423 (hasSummary && (template["card-background"] || components["background"]));
@@ -478,12 +479,16 @@ function cardString(template, components) {
478 heightCode = 'width / artShape.aspect';
479 heightCode = 'width / artShape.aspect';
479 }
480 }
480
481
482+ var aspectRatio = components["art"] && components["art"]["aspect-ratio"] || 1;
483+ if (typeof aspectRatio !== "number") {
484+ aspectRatio = 1;
485+ }
481 var fallback = components["art"] && components["art"]["fallback"] || "";
486 var fallback = components["art"] && components["art"]["fallback"] || "";
482 var fallbackCode = "";
487 var fallbackCode = "";
483 if (fallback !== "") {
488 if (fallback !== "") {
484 fallbackCode += 'onStatusChanged: if (status === Image.Error) source = "%1";'.arg(fallback);
489 fallbackCode += 'onStatusChanged: if (status === Image.Error) source = "%1";'.arg(fallback);
485 }
490 }
486− code += kArtShapeHolderCode.arg(artAnchors).arg(widthCode).arg(heightCode).arg(fallbackCode);
491+ code += kArtShapeHolderCode.arg(artAnchors).arg(widthCode).arg(heightCode).arg(aspectRatio).arg(isConciergeMode ? "false" : "true").arg(fallbackCode);
487 } else {
492 } else {
488 code += 'readonly property size artShapeSize: Qt.size(-1, -1);\n'
493 code += 'readonly property size artShapeSize: Qt.size(-1, -1);\n'
489 }
494 }
qml/Dash/CardCarousel.qml−1
@@ -64,7 +64,6 @@ DashRenderer {
64 item.fixedHeaderHeight = Qt.binding(function() { return carousel.headerHeight; });
64 item.fixedHeaderHeight = Qt.binding(function() { return carousel.headerHeight; });
65 item.height = Qt.binding(function() { return cardTool.cardHeight; });
65 item.height = Qt.binding(function() { return cardTool.cardHeight; });
66 item.cardData = Qt.binding(function() { return model; });
66 item.cardData = Qt.binding(function() { return model; });
67− item.components = Qt.binding(function() { return cardTool.components; });
68 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
67 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
69 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
68 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
70 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
69 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
qml/Dash/CardGrid.qml−1
@@ -68,7 +68,6 @@ DashRenderer {
68 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
68 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
69 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
69 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
70 item.cardData = Qt.binding(function() { return model; });
70 item.cardData = Qt.binding(function() { return model; });
71− item.components = Qt.binding(function() { return cardTool.components; });
72 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
71 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
73 item.scopeStyle = root.scopeStyle;
72 item.scopeStyle = root.scopeStyle;
74 item.artShapeStyle = root.artShapeStyle;
73 item.artShapeStyle = root.artShapeStyle;
qml/Dash/CardHorizontalList.qml−1
@@ -53,7 +53,6 @@ DashRenderer {
53 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
53 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
54 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
54 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
55 item.cardData = Qt.binding(function() { return model; });
55 item.cardData = Qt.binding(function() { return model; });
56− item.components = Qt.binding(function() { return cardTool.components; });
57 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
56 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
58 item.scopeStyle = root.scopeStyle;
57 item.scopeStyle = root.scopeStyle;
59 }
58 }
qml/Dash/CardTool.qml−1
@@ -220,7 +220,6 @@ Item {
220 onLoaded: {
220 onLoaded: {
221 item.objectName = "cardToolCard";
221 item.objectName = "cardToolCard";
222 item.asynchronous = false;
222 item.asynchronous = false;
223− item.components = Qt.binding(function() { return cardTool.components; });
224 item.width = Qt.binding(function() { return cardTool.cardWidth !== -1 ? cardTool.cardWidth : item.implicitWidth; });
223 item.width = Qt.binding(function() { return cardTool.cardWidth !== -1 ? cardTool.cardWidth : item.implicitWidth; });
225 item.height = Qt.binding(function() { return cardTool.cardHeight !== -1 ? cardTool.cardHeight : item.implicitHeight; });
224 item.height = Qt.binding(function() { return cardTool.cardHeight !== -1 ? cardTool.cardHeight : item.implicitHeight; });
226 }
225 }
qml/Dash/CardVerticalJournal.qml−1
@@ -72,7 +72,6 @@ DashRenderer {
72 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
72 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
73 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
73 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
74 item.cardData = Qt.binding(function() { return model; });
74 item.cardData = Qt.binding(function() { return model; });
75− item.components = Qt.binding(function() { return cardTool.components; });
76 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
75 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
77 item.scopeStyle = root.scopeStyle;
76 item.scopeStyle = root.scopeStyle;
78 }
77 }
tests/plugins/Dash/cardcreator/1.res+3−5
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
@@ -30,7 +29,6 @@ Item {
30 sourceComponent: Item {
29 sourceComponent: Item {
31 id: artShape;
30 id: artShape;
32 objectName: "artShape";
31 objectName: "artShape";
33− readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true;
34 visible: image.status == Image.Ready;
32 visible: image.status == Image.Ready;
35 readonly property alias image: artImage;
33 readonly property alias image: artImage;
36 ShaderEffectSource {
34 ShaderEffectSource {
@@ -39,11 +37,11 @@ Item {
39 anchors.centerIn: parent;
37 anchors.centerIn: parent;
40 width: 1;
38 width: 1;
41 height: 1;
39 height: 1;
42− hideSource: doShapeItem;
40+ hideSource: true;
43 }
41 }
44 Loader {
42 Loader {
45 anchors.fill: parent;
43 anchors.fill: parent;
46− visible: artShape.doShapeItem;
44+ visible: true;
47 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
45 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
48 Component {
46 Component {
49 id: artShapeShapeComponent;
47 id: artShapeShapeComponent;
@@ -67,7 +65,7 @@ Item {
67 }
65 }
68 }
66 }
69 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
67 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
70− readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
68+ readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1.6;
71 Component.onCompleted: { updateWidthHeightBindings(); }
69 Component.onCompleted: { updateWidthHeightBindings(); }
72 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
70 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
73 function updateWidthHeightBindings() {
71 function updateWidthHeightBindings() {
tests/plugins/Dash/cardcreator/2.res−1
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
tests/plugins/Dash/cardcreator/3.res+3−5
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
@@ -30,7 +29,6 @@ Item {
30 sourceComponent: Item {
29 sourceComponent: Item {
31 id: artShape;
30 id: artShape;
32 objectName: "artShape";
31 objectName: "artShape";
33− readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true;
34 visible: image.status == Image.Ready;
32 visible: image.status == Image.Ready;
35 readonly property alias image: artImage;
33 readonly property alias image: artImage;
36 ShaderEffectSource {
34 ShaderEffectSource {
@@ -39,11 +37,11 @@ Item {
39 anchors.centerIn: parent;
37 anchors.centerIn: parent;
40 width: 1;
38 width: 1;
41 height: 1;
39 height: 1;
42− hideSource: doShapeItem;
40+ hideSource: true;
43 }
41 }
44 Loader {
42 Loader {
45 anchors.fill: parent;
43 anchors.fill: parent;
46− visible: artShape.doShapeItem;
44+ visible: true;
47 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
45 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
48 Component {
46 Component {
49 id: artShapeShapeComponent;
47 id: artShapeShapeComponent;
@@ -67,7 +65,7 @@ Item {
67 }
65 }
68 }
66 }
69 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
67 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
70− readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
68+ readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 0.75;
71 Component.onCompleted: { updateWidthHeightBindings(); }
69 Component.onCompleted: { updateWidthHeightBindings(); }
72 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
70 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
73 function updateWidthHeightBindings() {
71 function updateWidthHeightBindings() {
tests/plugins/Dash/cardcreator/4.res−1
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
tests/plugins/Dash/cardcreator/5.res+3−5
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
@@ -30,7 +29,6 @@ Item {
30 sourceComponent: Item {
29 sourceComponent: Item {
31 id: artShape;
30 id: artShape;
32 objectName: "artShape";
31 objectName: "artShape";
33− readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true;
34 visible: image.status == Image.Ready;
32 visible: image.status == Image.Ready;
35 readonly property alias image: artImage;
33 readonly property alias image: artImage;
36 ShaderEffectSource {
34 ShaderEffectSource {
@@ -39,11 +37,11 @@ Item {
39 anchors.centerIn: parent;
37 anchors.centerIn: parent;
40 width: 1;
38 width: 1;
41 height: 1;
39 height: 1;
42− hideSource: doShapeItem;
40+ hideSource: false;
43 }
41 }
44 Loader {
42 Loader {
45 anchors.fill: parent;
43 anchors.fill: parent;
46− visible: artShape.doShapeItem;
44+ visible: false;
47 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
45 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
48 Component {
46 Component {
49 id: artShapeShapeComponent;
47 id: artShapeShapeComponent;
@@ -67,7 +65,7 @@ Item {
67 }
65 }
68 }
66 }
69 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
67 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
70− readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
68+ readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1;
71 Component.onCompleted: { updateWidthHeightBindings(); }
69 Component.onCompleted: { updateWidthHeightBindings(); }
72 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
70 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
73 function updateWidthHeightBindings() {
71 function updateWidthHeightBindings() {
tests/plugins/Dash/cardcreator/5.tst+1−1
@@ -1,3 +1,3 @@
1template: {"non-interactive":true,"card-layout":"vertical","card-size":"medium","category-layout":"carousel","collapsed-rows":2,"overlay":true}
1template: {"non-interactive":true,"card-layout":"vertical","card-size":"medium","category-layout":"carousel","collapsed-rows":2,"overlay":true}
2−components: {"art":{"aspect-ratio":1,"field":"art"},"subtitle":{"field":"artist"},"title":{"field":"title"},"attributes":{}}
2+components: {"art":{"aspect-ratio":1,"field":"art","conciergeMode":true},"subtitle":{"field":"artist"},"title":{"field":"title"},"attributes":{}}
3result: 5.res
3result: 5.res
tests/plugins/Dash/cardcreator/6.res−1
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
tests/plugins/Dash/cardcreator/7.res−1
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
tests/plugins/Dash/cardcreator/8.res+1−2
@@ -1,7 +1,6 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
3+ property var cardData;
4− property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
7 property real fontScale: 1.0;
6 property real fontScale: 1.0;
tests/plugins/Dash/cardcreator/9.res−1
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
tests/qmltests/Dash/tst_Card.qml−1
@@ -130,7 +130,6 @@ Rectangle {
130 sourceComponent: cardTool.cardComponent
130 sourceComponent: cardTool.cardComponent
131 clip: true
131 clip: true
132 onLoaded: {
132 onLoaded: {
133− item.components = Qt.binding(function() { return cardTool.components; });
134 item.cardData = Qt.binding(function() { return Helpers.mapData(dataArea.text, cardTool.components, dataError); });
133 item.cardData = Qt.binding(function() { return Helpers.mapData(dataArea.text, cardTool.components, dataError); });
135 item.width = Qt.binding(function() { return cardTool.cardWidth || item.implicitWidth; });
134 item.width = Qt.binding(function() { return cardTool.cardWidth || item.implicitWidth; });
136 item.height = Qt.binding(function() { return cardTool.cardHeight || item.implicitHeight; });
135 item.height = Qt.binding(function() { return cardTool.cardHeight || item.implicitHeight; });
tests/qmltests/Dash/tst_CardBenchmark.qml−2
@@ -61,8 +61,6 @@ Rectangle {
61 item.width = Qt.binding(function() { return cardTool.cardWidth || implicitWidth; });
61 item.width = Qt.binding(function() { return cardTool.cardWidth || implicitWidth; });
62 item.height = Qt.binding(function() { return cardTool.cardHeight || implicitHeight; });
62 item.height = Qt.binding(function() { return cardTool.cardHeight || implicitHeight; });
63 item.cardData = Qt.binding(function() { return Helpers.mapData(root.cardData, cardTool.components); });
63 item.cardData = Qt.binding(function() { return Helpers.mapData(root.cardData, cardTool.components); });
64− item.template = Qt.binding(function() { return cardTool.template; });
65− item.components = Qt.binding(function() { return cardTool.components; });
66 }
64 }
67 }
65 }
68 }
66 }