All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Radiant::MouseEvent Class Reference

This class describes a mouse event. More...

#include <Radiant/KeyEvent.hpp>

Public Member Functions

Qt::MouseButton button () const
 Return the button that generated the event. More...
 
Qt::MouseButtons buttons () const
 Return the button state when the event was generated. More...
 
int delta () const
 Return the distance the mouse wheel is rotated, in eights of a degree. More...
 
Nimble::Vector2f location () const
 Get the location of the mouse cursor at the time of the event. More...
 
Qt::KeyboardModifiers modifiers () const
 Return the keyboard modifiers at the time of the event. More...
 
 MouseEvent (const QMouseEvent &event)
 Construct a MouseEvent. More...
 
 MouseEvent (const QWheelEvent &event)
 Construct a MouseEvent. More...
 
 MouseEvent (QEvent::Type type, const Nimble::Vector2f &location, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
 Construct a MouseEvent. More...
 
 MouseEvent (MouseEvent &&)=default
 
 MouseEvent (const MouseEvent &e)
 Construct a copy of a MouseEvent. More...
 
MouseEventoperator= (MouseEvent &&)=default
 
MouseEventoperator= (const MouseEvent &ev)
 Construct a copy of a MouseEvent. More...
 
void setLocation (const Nimble::Vector2f &location)
 Set the location of the mouse cursor at the time of the event. More...
 
void setType (QEvent::Type type)
 Set the type of the event. More...
 
QEvent::Type type () const
 Get the type of the event. More...
 
virtual ~MouseEvent ()
 Destructor.
 

Detailed Description

This class describes a mouse event.

Mouse events are produced when the application has input focus and a mouse is either moved, or a button is pressed or relesed.

Constructor & Destructor Documentation

Radiant::MouseEvent::MouseEvent ( const QMouseEvent &  event)

Construct a MouseEvent.

Parameters
eventQMouseEvent to copy
Radiant::MouseEvent::MouseEvent ( const QWheelEvent &  event)

Construct a MouseEvent.

Parameters
eventQWheelEvent to copy
Radiant::MouseEvent::MouseEvent ( QEvent::Type  type,
const Nimble::Vector2f location,
Qt::MouseButton  button,
Qt::MouseButtons  buttons,
Qt::KeyboardModifiers  modifiers 
)

Construct a MouseEvent.

Parameters
typemust be one of QEvent::MouseButtonPress, QEvent::MouseButtonRelease, QEvent::MouseButtonDblClick, or QEvent::MouseMove
locationmouse cursor's location
buttonthe button that caused the event. If the event type is QEvent::MouseMove, the appropriate button for the event is Qt::NoButton
buttonsstate of the mouse buttons
modifiersstate of keyboard modifiers
Radiant::MouseEvent::MouseEvent ( const MouseEvent e)

Construct a copy of a MouseEvent.

Parameters
eevent to copy

Member Function Documentation

Qt::MouseButton Radiant::MouseEvent::button ( ) const

Return the button that generated the event.

Returns
button that generated the event
Qt::MouseButtons Radiant::MouseEvent::buttons ( ) const

Return the button state when the event was generated.

Returns
state of the buttons
int Radiant::MouseEvent::delta ( ) const

Return the distance the mouse wheel is rotated, in eights of a degree.

Returns
distance the wheel is rotated
Nimble::Vector2f Radiant::MouseEvent::location ( ) const

Get the location of the mouse cursor at the time of the event.

Returns
location of the mouse cursor
Qt::KeyboardModifiers Radiant::MouseEvent::modifiers ( ) const

Return the keyboard modifiers at the time of the event.

Returns
keyboard modifiers
MouseEvent& Radiant::MouseEvent::operator= ( const MouseEvent ev)

Construct a copy of a MouseEvent.

Parameters
evevent to copy
Returns
reference to this
void Radiant::MouseEvent::setLocation ( const Nimble::Vector2f location)

Set the location of the mouse cursor at the time of the event.

Parameters
locationlocation to set
void Radiant::MouseEvent::setType ( QEvent::Type  type)

Set the type of the event.

Parameters
typenew event type
QEvent::Type Radiant::MouseEvent::type ( ) const

Get the type of the event.

Returns
event type