[SOLVED] qml and qt: pressing buttons
-
how to receive the "button pressed"'s signal? i would to say this: !http://farm7.static.flickr.com/6004/5960480374_db013832fc_m.jpg()!
-
your question is not clear and link to the image does not work...
-
Use signals & slots. If you using Qt C++, it's easy to connect your signals & slots. If you using QML, i assumed you use your custom button element, so you can:
- In your button's mouseArea, do something when
@onPressed: {}@ - Use connect to make your signal and function's connection.
I think you'd better read how to use signals & slots with QML first :D
- In your button's mouseArea, do something when
-
-
I guess these buttons are Qt::Key_Send, Qt::Key_Menu, and Qt::Key_End
Inside your qml item
@Keys.onPressed: {
if (event.key == Qt.Key_Send) {
console.log("call button pressed");
event.accepted = true;
}
}
@ -
[quote author="Vijay Bhaska Reddy" date="1311249782"]I guess these buttons are Qt::Key_Send, Qt::Key_Menu, and Qt::Key_End
Inside your qml item
Keys.onPressed: {
if (event.key == Qt.Key_Send) {
console.log("call button pressed");
event.accepted = true;
}
}
[/quote]Also, if you want to recieve keyboard events, make sure this:
@
// Inside your element definition
focus: true
@