paysages3d/src/interface/modeler/qml/BaseChoice.qml

39 lines
789 B
QML
Raw Normal View History

2014-08-28 13:09:47 +00:00
import QtQuick 2.0
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
Item {
default property alias children : inner_layout.children
2015-08-19 23:15:08 +00:00
property alias spacing : inner_layout.spacing
2014-08-28 13:09:47 +00:00
property int value
ExclusiveGroup {
id: choice_group
onCurrentChanged: value = current.value
}
Row {
id: inner_layout
spacing: 5
anchors.fill: parent
}
onValueChanged: {
for (var i = 0; i < children.length; i++)
{
if (children[i].value == value)
{
choice_group.current = children[i];
}
}
}
2014-08-28 13:09:47 +00:00
onChildrenChanged: {
for (var i = 0; i < children.length; i++)
{
children[i].exclusiveGroup = choice_group;
}
}
}