diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2012-11-07 16:23:32 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-10 20:08:28 +0100 |
commit | 2d07d3b4e3036179667a822aa40285d071b76b9e (patch) | |
tree | 715e5c6a92426f1ac1cd4cd585e02cf8cab05002 /src/gui/kernel/qevent.h | |
parent | 1fe0c2c25dc96e9af6f442cf059ad627d45f10fa (diff) |
Add a QEnterEvent containing the mouse position.
Enter handling requires knowledge of the mouse
position. Extend the enter handling of
QWindowSystemInterface to receive the position
(implemented for Windows, XCB and Mac), passing it
on to QEnterEvent. Dispatch QEnterEvent from
widgets code.
Change-Id: I49c07d2b1f46310c877017dd55d4cd7d636bdbce
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r-- | src/gui/kernel/qevent.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index b35dd88c2a..82d22aec05 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -83,6 +83,28 @@ protected: ulong ts; }; +class Q_GUI_EXPORT QEnterEvent : public QEvent +{ +public: + QEnterEvent(const QPointF &localPos, const QPointF &windowPos, const QPointF &screenPos); + ~QEnterEvent(); + +#ifndef QT_NO_INTEGER_EVENT_COORDINATES + inline QPoint pos() const { return l.toPoint(); } + inline QPoint globalPos() const { return s.toPoint(); } + inline int x() const { return qRound(l.x()); } + inline int y() const { return qRound(l.y()); } + inline int globalX() const { return qRound(s.x()); } + inline int globalY() const { return qRound(s.y()); } +#endif + const QPointF &localPos() const { return l; } + const QPointF &windowPos() const { return w; } + const QPointF &screenPos() const { return s; } + +protected: + QPointF l, w, s; +}; + class Q_GUI_EXPORT QMouseEvent : public QInputEvent { public: |