diff options
author | Shawn Rutledge <shawn.rutledge@theqtcompany.com> | 2016-03-04 11:02:54 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@theqtcompany.com> | 2016-03-11 12:15:26 +0000 |
commit | 644a6a42a45ceb9790df6d6ee1c3ba43c7b9ab10 (patch) | |
tree | 493c315698238fb1736cbd29d90a52d5351feb0a /src/quick/items/qquickitemsmodule.cpp | |
parent | 6300f4dde0ab3279b18a0fb29f94cfe142557cba (diff) |
MouseArea: add source property to mouse event
It comes from the source() of the QMouseEvent which triggered it.
This makes it possible to distinguish real mouse events from those
that are synthesized from touch or tablet.
And for this we need to import QtQuick 2.7
[ChangeLog][QtQuick][MouseArea] Added mouse.source property
to enable distinguishing genuine mouse events from those that
are synthesized from touch or tablet events.
Change-Id: I568964f63981703bd23e05daac5288518f09d837
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/quick/items/qquickitemsmodule.cpp')
-rw-r--r-- | src/quick/items/qquickitemsmodule.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp index ce4f81e1dd..23245e4a7b 100644 --- a/src/quick/items/qquickitemsmodule.cpp +++ b/src/quick/items/qquickitemsmodule.cpp @@ -285,6 +285,8 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType<QQuickGridView, 7>(uri, 2, 7, "GridView"); qmlRegisterType<QQuickTextInput, 7>(uri, 2, 7, "TextInput"); qmlRegisterType<QQuickTextEdit, 7>(uri, 2, 7, "TextEdit"); + + qmlRegisterUncreatableType<QQuickMouseEvent, 7>(uri, 2, 7, nullptr, QQuickMouseEvent::tr("MouseEvent is only available within handlers in MouseArea")); } static void initResources() |