v2.0.0
Loading...
Searching...
No Matches
DISPLIB::LayoutScene Class Reference

Base QGraphicsScene providing pan, pinch-zoom and swipe gesture handling for sensor-layout scenes. More...

#include <layoutscene.h>

Public Member Functions

 LayoutScene (QGraphicsView *view, QObject *parent=0)

Protected Member Functions

void wheelEvent (QGraphicsSceneWheelEvent *event)
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *mouseEvent)
void mousePressEvent (QGraphicsSceneMouseEvent *mouseEvent)
void mouseMoveEvent (QGraphicsSceneMouseEvent *mouseEvent)
void mouseReleaseEvent (QGraphicsSceneMouseEvent *mouseEvent)
void keyPressEvent (QKeyEvent *keyEvent)
void keyReleaseEvent (QKeyEvent *keyEvent)
bool event (QEvent *event)
bool gestureEvent (QGestureEvent *event)
void panTriggered (QPanGesture *)
void pinchTriggered (QPinchGesture *)
void swipeTriggered (QSwipeGesture *)
bool eventFilter (QObject *object, QEvent *event)

Protected Attributes

QGraphicsView * m_qvView
bool m_bDragMode
QPointF m_mousePressPosition

Detailed Description

Base QGraphicsScene providing pan, pinch-zoom and swipe gesture handling for sensor-layout scenes.

Installs gesture recognisers on the active view and translates pan / pinch / swipe events into view-zoom / view-pan operations regardless of input device.

Definition at line 69 of file layoutscene.h.

Inheritance diagram for DISPLIB::LayoutScene:
Inheritance graph

Constructor & Destructor Documentation

◆ LayoutScene()

LayoutScene::LayoutScene ( QGraphicsView * view,
QObject * parent = 0 )

Constructs a LayoutScene.

Parameters
[in]viewGraphics view that displays this scene and is zoomed/panned by it.
[in]parentParent QObject (default 0).

Definition at line 41 of file layoutscene.cpp.

Member Function Documentation

◆ event()

bool LayoutScene::event ( QEvent * event)
protected

reimplemented event function - intercepts touch gestures

Parameters
[in]eventThe incoming event.
Returns
True if the event was a gesture and was handled, otherwise the QGraphicsScene result.

Definition at line 187 of file layoutscene.cpp.

◆ eventFilter()

bool LayoutScene::eventFilter ( QObject * object,
QEvent * event )
protected

Installed event filter.

Parameters
[in]objectthe qt object for which the event was intercpeted.
[in]eventthe current event.
Returns
True if a gesture event on the view was handled, false otherwise.

Definition at line 238 of file layoutscene.cpp.

◆ gestureEvent()

bool LayoutScene::gestureEvent ( QGestureEvent * event)
protected

gestureEvent processes gesture events

Parameters
[in]eventGesture event whose pan and pinch gestures are dispatched.
Returns
Always true.

Definition at line 205 of file layoutscene.cpp.

◆ keyPressEvent()

void LayoutScene::keyPressEvent ( QKeyEvent * keyEvent)
protected

Reimplemented key press event.

Parameters
[in]keyEventThe key event, forwarded to QGraphicsScene.

Definition at line 167 of file layoutscene.cpp.

◆ keyReleaseEvent()

void LayoutScene::keyReleaseEvent ( QKeyEvent * keyEvent)
protected

Reimplemented key release event.

Parameters
[in]keyEventThe key event, forwarded to QGraphicsScene.

Definition at line 177 of file layoutscene.cpp.

◆ mouseDoubleClickEvent()

void LayoutScene::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent * mouseEvent)
protected

Reimplemented double mouse press event.

Parameters
[in]mouseEventThe mouse event; a left double click fits all items into the view.

Definition at line 74 of file layoutscene.cpp.

◆ mouseMoveEvent()

void LayoutScene::mouseMoveEvent ( QGraphicsSceneMouseEvent * mouseEvent)
protected

Reimplemented double mouse move event.

Parameters
[in]mouseEventThe mouse event; pans the view while in drag mode.

Definition at line 112 of file layoutscene.cpp.

◆ mousePressEvent()

void LayoutScene::mousePressEvent ( QGraphicsSceneMouseEvent * mouseEvent)
protected

Reimplemented mouse press event.

Parameters
[in]mouseEventThe mouse event; left starts rubber-band selection, right starts panning.

Definition at line 84 of file layoutscene.cpp.

◆ mouseReleaseEvent()

void LayoutScene::mouseReleaseEvent ( QGraphicsSceneMouseEvent * mouseEvent)
protected

Reimplemented double mouse release event.

Parameters
[in]mouseEventThe mouse event; ends drag mode.

Definition at line 129 of file layoutscene.cpp.

◆ panTriggered()

void LayoutScene::panTriggered ( QPanGesture * gesture)
protected

pinchTriggered processes pan gesture events

Definition at line 220 of file layoutscene.cpp.

◆ pinchTriggered()

void LayoutScene::pinchTriggered ( QPinchGesture * gesture)
protected

pinchTriggered processes pinch gesture events

Definition at line 230 of file layoutscene.cpp.

◆ swipeTriggered()

void DISPLIB::LayoutScene::swipeTriggered ( QSwipeGesture * )
protected

pinchTriggered processes swipe gesture events

◆ wheelEvent()

void LayoutScene::wheelEvent ( QGraphicsSceneWheelEvent * event)
protected

Reimplemented wheel event.

Parameters
[in]eventThe wheel event; scales the view by 1.15 per step under the mouse.

Definition at line 57 of file layoutscene.cpp.

Member Data Documentation

◆ m_bDragMode

bool DISPLIB::LayoutScene::m_bDragMode
protected

Flag whether the drag mode is activated.

Definition at line 193 of file layoutscene.h.

◆ m_mousePressPosition

QPointF DISPLIB::LayoutScene::m_mousePressPosition
protected

The current mouse press location.

Definition at line 195 of file layoutscene.h.

◆ m_qvView

QGraphicsView* DISPLIB::LayoutScene::m_qvView
protected

The view which visualizes this scene.

Definition at line 190 of file layoutscene.h.


The documentation for this class was generated from the following files: