|QHoverEvent(Type type, const QPoint & pos, const QPoint & oldPos)|
|const QPoint &||oldPos() const|
|const QPoint &||pos() const|
- 6 public functions inherited from QEvent
Additional Inherited Members
The QHoverEvent class contains parameters that describe a mouse event.
Mouse events occur when a mouse cursor is moved into, out of, or within a widget, and if the widget has the Qt::WA_Hover attribute.
There are a few similarities between the events QEvent::HoverEnter and QEvent::HoverLeave, and the events QEvent::Enter and QEvent::Leave. However, they are slightly different because we do an update() in the event handler of HoverEnter and HoverLeave.
Now, if you move the cursor from the top to the bottom in the middle of A, you will get the following QEvent::MouseMove events:
You will get the same events for QEvent::HoverMove, except that the event always propagates to the top-level regardless whether the event is accepted or not. It will only stop propagating with the Qt::WA_NoMousePropagation attribute.
In this case the events will occur in the following way:
- A::HoverMove, B::HoverMove
- A::HoverMove, B::HoverMove, C::HoverMove
Member Function Documentation
Constructs a hover event object.
The pos is the current mouse cursor's position relative to the receiving widget, while oldPos is the previous mouse cursor's position relative to the receiving widget.
const QPoint & QHoverEvent::oldPos() const
Returns the previous position of the mouse cursor, relative to the widget that received the event. If there is no previous position, oldPos() will return the same position as pos().
See also pos().
const QPoint & QHoverEvent::pos() const
Returns the position of the mouse cursor, relative to the widget that received the event.
See also oldPos().
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. 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.