Fix: update sliders when profile changes.

This commit is contained in:
Filippo Scognamiglio 2014-06-27 16:27:27 +02:00
parent 30074f3814
commit d6b644cd7d
2 changed files with 6 additions and 14 deletions

View File

@ -23,12 +23,12 @@ import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
RowLayout {
property string name
property alias name: check.text
property double value: (check.checked) ? _value : 0.0
property double _value: 0.0
property double min_value: 0.0
property double max_value: 1.0
property double stepSize: 0.01
property alias _value: slider.value
property alias min_value: slider.minimumValue
property alias max_value: slider.maximumValue
property alias stepSize: slider.stepSize
id: setting_component
anchors.left: parent.left
@ -38,21 +38,13 @@ RowLayout {
CheckBox{
id: check
implicitWidth: 150
text: name
Component.onCompleted: checked = (_value !== 0);
}
Slider{
id: slider
stepSize: parent.stepSize
minimumValue: min_value
maximumValue: max_value
onValueChanged: setting_component._value = slider.value;
Layout.fillWidth: true
enabled: check.checked
value: setting_component._value
Component.onCompleted: slider.value = setting_component._value
}
Text{
id: textfield

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.0.1, 2014-06-26T21:03:57. -->
<!-- Written by QtCreator 3.0.1, 2014-06-27T16:14:00. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>