import Qt 4.7
Rectangle {
+ id: rectangle1
+ color: myPalette.base
+ anchors.fill: parent
function changeWordState(nr, state) {
wordList.currentIndex = nr
function setEnabled(Boolean) { wordList.enabled = Boolean } // slot
signal wordSelected(string word);
-
+ signal checkFocus();
SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
- id: rectangle1
- color: myPalette.base
- anchors.fill: parent
-
ElementsListView{
id: wordList
width: rectangle1.width
delegate: Component{
id: wordListDelegate
Item {
+ onActiveFocusChanged: rectangle1.checkFocus();
+
width: rectangle1.width
height: {
if (wordText.height + 4 > check.height)
else
return check.height;
}
-
MouseArea{
anchors.fill: parent
- onClicked: {
+ onClicked: wordList.currentIndex = number
+ onDoubleClicked: {
wordList.currentIndex = number
rectangle1.wordSelected(word)
}
}
}
}
-
}
-
}
model: wordModel
}
+
+ states: [
+ State {
+ name: "noFocus";
+ when: ((!wordList.focus) && (!rectangle1.focus))
+ PropertyChanges { target: wordList.highlightItem; opacity:0}
+ }
+ ]
}