QMouseEvent Class Reference


The QMouseEvent class contains parameters that describe a mouse event. (details) (complete member list)

#include <qevent.h>

Inherits QEvent.

Public Members


Detailed Description

The QMouseEvent class contains parameters that describe a mouse event.

The virtual functions QWidget::mousePressEvent(), QWidget::mouseReleaseEvent(), QWidget::mouseDoubleClickEvent() and QWidget::mouseMoveEvent() receive mouse events.


Member Function Documentation

QMouseEvent::QMouseEvent (int type, const QPoint &pos, int button, int state)

Constructs a mouse event object.

The type parameter must be Event_MouseButtonPress, Event_MouseButtonRelease, Event_MouseButtonDblClick or Event_MouseMove.

int QMouseEvent::button () const

Returns the button that caused the event.

Possible return values are LeftButton, RightButton, MidButton and NoButton.

The button value is always NoButton (0) when a mouse move event is received.

QPoint & QMouseEvent::pos ()

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

int QMouseEvent::state () const

Returns the current button state (a combination of mouse buttons and keyboard modifiers).

The returned value is LeftButton, RightButton, MidButton, ShiftButton, ControlButton and AltButton OR'ed together.


This file is part of the Qt toolkit, copyright 1995 Troll Tech, all rights reserved.

It was generated from the following files:


Generated at 04:27, 1995/05/20 by the webmaster at Troll Tech