QHoverEvent Class Reference

#include <qevent.h>

Inheritance diagram for QHoverEvent:

Inheritance graph
[legend]
Collaboration diagram for QHoverEvent:

Collaboration graph
[legend]
List of all members.

Detailed Description

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.

The function pos() gives the current cursor position, while oldPos() gives the old mouse position.

Definition at line 88 of file qevent.h.

Public Member Functions

 QHoverEvent (Type type, const QPoint &pos, const QPoint &oldPos)
 ~QHoverEvent ()
const QPointpos () const
const QPointoldPos () const

Protected Attributes

QPoint p
QPoint op


Constructor & Destructor Documentation

QHoverEvent::QHoverEvent ( Type  type,
const QPoint pos,
const QPoint oldPos 
)

Constructs a hover event object.

The type parameter must be QEvent::HoverEnter, QEvent::HoverLeave, or QEvent::HoverMove.

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.

Definition at line 356 of file qevent.cpp.

00357     : QEvent(type), p(pos), op(oldPos)
00358 {
00359 }

QHoverEvent::~QHoverEvent (  ) 

Definition at line 364 of file qevent.cpp.

00365 {
00366 }


Member Function Documentation

const QPoint & QHoverEvent::pos (  )  const [inline]

Returns the position of the mouse cursor, relative to the widget that received the event.

On QEvent::HoverLeave events, this position will always be QPoint(-1, -1).

See also:
oldPos()

Definition at line 94 of file qevent.h.

References p.

Referenced by QHeaderView::event(), and QAbstractItemView::viewportEvent().

00094 { return p; }

const QPoint & QHoverEvent::oldPos (  )  const [inline]

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().

On QEvent::HoverEnter events, this position will always be QPoint(-1, -1).

See also:
pos()

Definition at line 95 of file qevent.h.

00095 { return op; }


Member Data Documentation

QPoint QHoverEvent::p [protected]

Definition at line 98 of file qevent.h.

QPoint QHoverEvent::op [protected]

Definition at line 98 of file qevent.h.


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 17:59:34 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1