summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-11-25 02:52:28 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-11-25 02:52:28 (GMT)
commit77d7cb79500cdb2ca277392ef5f7de79ec3e2823 (patch)
tree6b86042fcc9fddd5a71cb5dc4d31600f34ee17f0 /src
parentcb34d11e4c98e768432e00c867b3321d3b89dd9d (diff)
parentb04df748d8c170a969eb6a3097cbda7a08fb3ea1 (diff)
downloadQt-77d7cb79500cdb2ca277392ef5f7de79ec3e2823.zip
Qt-77d7cb79500cdb2ca277392ef5f7de79ec3e2823.tar.gz
Qt-77d7cb79500cdb2ca277392ef5f7de79ec3e2823.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Document KeyEvent::modifiers
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeevents.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeevents.cpp b/src/declarative/graphicsitems/qdeclarativeevents.cpp
index 61fd562..4b5e777 100644
--- a/src/declarative/graphicsitems/qdeclarativeevents.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeevents.cpp
@@ -108,6 +108,34 @@ Item {
so that ancestor items do not also respond to the same event.
*/
+/*!
+ \qmlproperty int KeyEvent::modifiers
+
+ This property holds the keyboard modifier flags that existed immediately
+ before the event occurred.
+
+ It contains a bitwise combination of:
+ \list
+ \o Qt.NoModifier - No modifier key is pressed.
+ \o Qt.ShiftModifier - A Shift key on the keyboard is pressed.
+ \o Qt.ControlModifier - A Ctrl key on the keyboard is pressed.
+ \o Qt.AltModifier - An Alt key on the keyboard is pressed.
+ \o Qt.MetaModifier - A Meta key on the keyboard is pressed.
+ \o Qt.KeypadModifier - A keypad button is pressed.
+ \endlist
+
+ For example, to react to a Shift key + Enter key combination:
+ \qml
+ Item {
+ focus: true
+ Keys.onPressed: {
+ if ((event.key == Qt.Key_Enter) && (event.modifiers & Qt.ShiftModifier))
+ doSomething();
+ }
+ }
+ \endqml
+*/
+
/*!
\qmlclass MouseEvent QDeclarativeMouseEvent
@@ -199,7 +227,7 @@ Item {
\qml
MouseArea {
onClicked: {
- if (mouse.button == Qt.LeftButton && mouse.modifiers & Qt.ShiftModifier)
+ if ((mouse.button == Qt.LeftButton) && (mouse.modifiers & Qt.ShiftModifier))
doSomething();
}
}