Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# Obsolete Members for QMouseEvent

The following class members are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

QMouseEvent class reference

### Public Functions

- Qt::ButtonState state () const `(obsolete)`

## Member Function Documentation

### Qt::ButtonState QMouseEvent::state () const

Returns the button state immediately before the event was generated. The button state is a combination of mouse buttons (see Qt::ButtonState) and keyboard modifiers (Qt::Modifier).

For example, for `QEvent::MouseButtonPress` and `QEvent::MouseButtonDblClick` event types, state() will not include the mouse button that's pressed. When the mouse button is released, the `QEvent::MouseButtonRelease` event has a state() that contains the button() that was initially pressed.

This value is mainly interesting for `QEvent::MouseMove`; for the other cases, button() is more useful.

The returned value is a selection of the following values, combined using the OR operator: `Qt::LeftButton`, `Qt::RightButton`, `Qt::MidButton`, `Qt::ShiftButton`, `Qt::ControlButton`, and `Qt::AltButton`.

See also button(), stateAfter(), and Qt::ButtonState.