Skip to content

Commit

Permalink
Properly initialize ValueMap widget lookup table
Browse files Browse the repository at this point in the history
Fix #31
  • Loading branch information
m-kuhn committed Apr 13, 2016
1 parent 82171bf commit f74cd09
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/qml/editorwidgets/ValueMap.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import QtQuick 2.0
import QtQuick.Controls 1.4

Item {
signal valueChanged( var value )
signal valueChanged(var value)

anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -19,14 +19,13 @@ Item {
Component.onCompleted: {
model = Object.keys(config);
for(var key in config) {
_reverseConfig[json[key]] = key;
_reverseConfig[config[key]] = key;
}

currentIndex = find(_reverseConfig[value])
}

onCurrentTextChanged: {
valueChanged( config[currentText] )
valueChanged(config[currentText])
}
}
}

0 comments on commit f74cd09

Please sign in to comment.