<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qtquickhandlers-index.qdoc --> <title>Qt Quick Input Handlers | Qt Quick 5.12.6</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td >Qt 5.12</td><td ><a href="qtquick-index.html">Qt Quick</a></td><td >Qt Quick Input Handlers</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right"><a href="qtquick-index.html">Qt 5.12.6 Reference Documentation</a></td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <div class="sidebar"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#input-handlers">Input Handlers</a></li> <li class="level1"><a href="#key-features">Key Features</a></li> <li class="level1"><a href="#related-information">Related Information</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">Qt Quick Input Handlers</h1> <span class="subtitle"></span> <!-- $$$qtquickhandlers-index.html-description --> <div class="descr"> <a name="details"></a> <p>Qt Quick Input Handlers are a set of QML types used to handle events from keyboard, touch, mouse, and stylus devices in a UI. In contrast to event-handling items, such as <a href="qml-qtquick-mousearea.html">MouseArea</a> and <a href="qml-qtquick-flickable.html">Flickable</a>, input handlers are explicitly non-visual, require less memory and are intended to be used in greater numbers: one handler instance per aspect of interaction. Each input handler instance handles certain events on behalf of its <code>parent</code> Item. Thus the visual and behavioral concerns are better separated, and the behavior is built up by finer-grained composition.</p> <p>In Qt 5.10, these handlers were introduced in a separate Qt.labs.handlers module. Now they are included with Qt Quick since 5.12. The pre-existing <a href="qml-qtquick-keys.html">Keys</a> attached property is similar in concept, so we refer to the pointing-device-oriented handlers plus <code>Keys</code> together as the set of Input Handlers. We expect to offer more attached-property use cases in future versions of Qt.</p> <a name="input-handlers"></a> <h2 id="input-handlers">Input Handlers</h2> <div class="table"><table class="annotated"> <tr class="odd topAlign"><td class="tblName"><p><a href="qml-qtquick-draghandler.html">DragHandler</a></p></td><td class="tblDescr"><p>Handler for dragging</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qml-qtquick-hoverhandler.html">HoverHandler</a></p></td><td class="tblDescr"><p>Handler for mouse and tablet hover</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qml-qtquick-keynavigation.html">KeyNavigation</a></p></td><td class="tblDescr"><p>Supports key navigation by arrow keys</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qml-qtquick-keys.html">Keys</a></p></td><td class="tblDescr"><p>Provides key handling to Items</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qml-qtquick-pinchhandler.html">PinchHandler</a></p></td><td class="tblDescr"><p>Handler for pinch gestures</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qml-qtquick-pointhandler.html">PointHandler</a></p></td><td class="tblDescr"><p>Handler for reacting to a single touchpoint</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qml-qtquick-taphandler.html">TapHandler</a></p></td><td class="tblDescr"><p>Handler for taps and clicks</p></td></tr> </table></div> <a name="key-features"></a> <h2 id="key-features">Key Features</h2> <p>Some of the key features are:</p> <ul> <li>Handle keystrokes within the focused Item</li> <li>Handle gestures such as tapping or dragging regardless which device it comes from</li> <li>Handle gestures from different classes of devices in different ways</li> <li>Each Item can have unlimited Handlers</li> </ul> <a name="related-information"></a> <h2 id="related-information">Related Information</h2> <ul> <li><a href="qtquick-index.html">Qt Quick</a></li> </ul> </div> <!-- @@@qtquickhandlers-index.html --> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2019 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.<br/> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br/> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. </p> </div> </body> </html>