Problem: I would like to give an area a keyboard shortcut like so:
Qt Code:
import Qt 4.7 Rectangle{ width: 50; height: 50; color: "red" focus: true Keys.onPressed: { if ( event.key == Qt.Key_A) keyEffect() } function keyEffect() {color = "blue"} }To copy to clipboard, switch view to plain text mode
I plan on using this type of element in a number of places (some in Columns/Rows/Grids, some in ListViews, etc. with different keyboard shortcuts each). However, when I try this only the last one instantiated ever gets checked since it takes away the focus from the others.
Question: How do I manage it so that all elements get checked when a key has been pressed?
Bookmarks