Advertisement
Guest User

Example 1 (tunneling)

a guest
Jun 25th, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 0.54 KB | None | 0 0
  1. import QtQuick 2.5
  2. import QtQuick.Window 2.2
  3. import QtQuick.Controls 1.4
  4.  
  5. Window {
  6.     visible: true
  7.     width: 640
  8.     height: 480
  9.     title: qsTr("Hello World")
  10.  
  11.     property int rightPressedCount: 0
  12.  
  13.     Item {
  14.         width: childrenRect.width
  15.         height: childrenRect.height
  16.         Keys.onPressedPreview: {
  17.             if (event.key === Qt.Key_Right) {
  18.                 console.log("Pressed")
  19.                 rightPressedCount++
  20.             }
  21.         }
  22.  
  23.         TextField {
  24.             focus: true
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement