From 728b47ef07c476a9f205ef4d5e8f60978fdd9f32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 27 Sep 2012 17:08:47 +0200 Subject: [PATCH] Use a Component for Explicit Spacers A component has the advantage that the width property can depend from other properties. This does not work with the previous on the fly construction as the width does not update when the referenced property changes. --- clients/aurorae/src/qml/ButtonGroup.qml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/clients/aurorae/src/qml/ButtonGroup.qml b/clients/aurorae/src/qml/ButtonGroup.qml index 578bb753bf..be2156de43 100644 --- a/clients/aurorae/src/qml/ButtonGroup.qml +++ b/clients/aurorae/src/qml/ButtonGroup.qml @@ -22,7 +22,7 @@ Item { var component = undefined; switch (buttons.charAt(i)) { case "_": - var button = Qt.createQmlObject("import QtQuick 1.1; Item{ width: " + group.explicitSpacer + "; height: parent.height}", groupRow, "dynamicGroup_" + buttons + i); + component = explicitSpacerComponent; break; case "A": component = group.maximizeButton; @@ -85,4 +85,12 @@ Item { } createButtons(); } + + Component { + id: explicitSpacerComponent + Item { + width: group.explicitSpacer + height: groupRow.height + } + } }