[Qt-qml] Key event capturing

Ben Marinic ben at combinationstudios.com
Wed Jul 28 22:44:49 CEST 2010


Hi

I'm having an issue with Key events.  The following works in my child  
QML file if I debug it directly:

Keys.onPressed: {
         console.log(event.key)
}
But if the child QML file is loaded in by another QML file (using a  
Loader) then the Key event doesn't seem to be captured (nothing traces  
out).  I have tried various "focus: true/false" combinations in both  
the parent and the child QMLs.
Also while trying to debug I attempted to set a break point.  Are  
break points possible in QML?  I can't set any in Qt Creator 2.1.0 and  
the docs don't mention them for QML: http://doc.trolltech.com/qtcreator-snapshot/creator-debugging-qml.html
Thanks,
Ben

Ben Marinic
Combination Studios Ltd
e. ben at combinationstudios.com
t. +44 (0)20 7193 2000
m. +44 (0)7813 147 159








More information about the Qt-qml mailing list