Rectangle {
function changeWordState(nr, state) {
- console.log("LOOOOOL")
wordList.currentIndex = nr
wordModel.setModelProperty(wordList.currentIndex, state, "isBookmarked")
+ }
+ function changeWordStateByIndex() {
+ wordModel.setModelPropertyByIndex(wordList.currentIndex, "isBookmarked")
}
function setEnabled(Boolean) { wordList.enabled = Boolean }
function setWordListEmpty(Boolean) { wordList.empty = Boolean }
function setFocus() {
- console.log("juhu")
wordList.setFocus()
-// activeFocus = true
- console.log(focus + "a " + activeFocus)
- console.log(wordList.focus + "b " + wordList.activeFocus)
}
signal wordSelected(string word);
+ signal wordSelectedByIndex(int nr);
SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
highlightResizeSpeed: 1000
property bool empty: false
- onCurrentIndexChanged: {
- console.log("111!!!WTF " + currentIndex)
+ Keys.onPressed: {
+ if (event.key == Qt.Key_Space && currentIndex >= 0){
+ rectangle1.changeWordStateByIndex();
+ } else if ((event.key == Qt.Key_Return || event.key == Qt.Key_Enter) && currentIndex >= 0){
+ rectangle1.wordSelectedByIndex(currentIndex)
+ }
}
delegate: Component{
MouseArea{
anchors.fill: parent
onClicked: {
- wordList.currentIndex = index// number
+ wordList.currentIndex = index
rectangle1.wordSelected(word)
}
}