Seamly2D
Code documentation
GraphicsViewZoom Class Reference

#include <vmaingraphicsview.h>

Inheritance diagram for GraphicsViewZoom:
Collaboration diagram for GraphicsViewZoom:

Public Slots

void verticalScrollingTime (qreal x)
 
void horizontalScrollingTime (qreal x)
 
void animFinished ()
 

Signals

void zoomed ()
 

Public Member Functions

 GraphicsViewZoom (QGraphicsView *view)
 
void gentleZoom (qreal factor)
 
void setModifiers (Qt::KeyboardModifiers modifiers)
 
void setZoomSpeedFactor (qreal value)
 
void initScrollAnimations ()
 

Protected Member Functions

virtual bool eventFilter (QObject *object, QEvent *event) Q_DECL_OVERRIDE
 

Private Member Functions

void fictiveSceneRect (QGraphicsScene *sc, QGraphicsView *view)
 
bool startVerticalScrollings (QWheelEvent *wheel_event)
 
bool startHorizontalScrollings (QWheelEvent *wheel_event)
 
bool gestureEvent (QGestureEvent *event)
 
void panTriggered (QPanGesture *gesture)
 
void pinchTriggered (QPinchGesture *gesture)
 

Private Attributes

QGraphicsView * m_view
 
Qt::KeyboardModifiers m_modifiers
 
qreal m_zoomSpeedFactor
 
QPointF targetScenePos
 
QPointF targetViewPos
 
int m_duration
 
int m_updateInterval
 
QTimeLine * verticalScrollAnim
 
qint32 m_numScheduledVerticalScrollings
 _numScheduledVerticalScrollings keep number scheduled vertical scrollings. More...
 
QTimeLine * horizontalScrollAnim
 
qint32 m_numScheduledHorizontalScrollings
 _numScheduledHorizontalScrollings keep number scheduled horizontal scrollings. More...
 
QGesture * pan
 
QGesture * pinch
 
qreal horizontalOffset
 
qreal verticalOffset
 
qreal scaleFactor
 
qreal currentScaleFactor
 

Detailed Description

Definition at line 102 of file vmaingraphicsview.h.

Constructor & Destructor Documentation

◆ GraphicsViewZoom()

GraphicsViewZoom::GraphicsViewZoom ( QGraphicsView *  view)
explicit

Member Function Documentation

◆ animFinished

void GraphicsViewZoom::animFinished ( )
slot

◆ eventFilter()

bool GraphicsViewZoom::eventFilter ( QObject *  object,
QEvent *  event 
)
protectedvirtual

◆ fictiveSceneRect()

void GraphicsViewZoom::fictiveSceneRect ( QGraphicsScene *  sc,
QGraphicsView *  view 
)
private

Definition at line 357 of file vmaingraphicsview.cpp.

References SCASSERT.

Referenced by gentleZoom().

◆ gentleZoom()

◆ gestureEvent()

bool GraphicsViewZoom::gestureEvent ( QGestureEvent *  event)
private

Definition at line 308 of file vmaingraphicsview.cpp.

References pan, panTriggered(), pinch, and pinchTriggered().

Referenced by eventFilter().

◆ horizontalScrollingTime

void GraphicsViewZoom::horizontalScrollingTime ( qreal  x)
slot

◆ initScrollAnimations()

void GraphicsViewZoom::initScrollAnimations ( )

◆ panTriggered()

void GraphicsViewZoom::panTriggered ( QPanGesture *  gesture)
private

Definition at line 326 of file vmaingraphicsview.cpp.

References horizontalOffset, m_view, and verticalOffset.

Referenced by gestureEvent().

◆ pinchTriggered()

void GraphicsViewZoom::pinchTriggered ( QPinchGesture *  gesture)
private

Definition at line 346 of file vmaingraphicsview.cpp.

References currentScaleFactor, and gentleZoom().

Referenced by gestureEvent().

◆ setModifiers()

void GraphicsViewZoom::setModifiers ( Qt::KeyboardModifiers  modifiers)

Definition at line 162 of file vmaingraphicsview.cpp.

References m_modifiers.

◆ setZoomSpeedFactor()

void GraphicsViewZoom::setZoomSpeedFactor ( qreal  value)

Definition at line 169 of file vmaingraphicsview.cpp.

References m_zoomSpeedFactor.

◆ startHorizontalScrollings()

bool GraphicsViewZoom::startHorizontalScrollings ( QWheelEvent *  wheel_event)
private

Definition at line 424 of file vmaingraphicsview.cpp.

References horizontalScrollAnim, m_numScheduledHorizontalScrollings, qApp, and SCASSERT.

Referenced by eventFilter().

◆ startVerticalScrollings()

bool GraphicsViewZoom::startVerticalScrollings ( QWheelEvent *  wheel_event)
private

Definition at line 387 of file vmaingraphicsview.cpp.

References m_numScheduledVerticalScrollings, qApp, SCASSERT, and verticalScrollAnim.

Referenced by eventFilter().

◆ verticalScrollingTime

void GraphicsViewZoom::verticalScrollingTime ( qreal  x)
slot

◆ zoomed

void GraphicsViewZoom::zoomed ( )
signal

Member Data Documentation

◆ currentScaleFactor

qreal GraphicsViewZoom::currentScaleFactor
private

Definition at line 152 of file vmaingraphicsview.h.

Referenced by pinchTriggered().

◆ horizontalOffset

qreal GraphicsViewZoom::horizontalOffset
private

Definition at line 149 of file vmaingraphicsview.h.

Referenced by panTriggered().

◆ horizontalScrollAnim

QTimeLine* GraphicsViewZoom::horizontalScrollAnim
private

Definition at line 135 of file vmaingraphicsview.h.

Referenced by initScrollAnimations(), and startHorizontalScrollings().

◆ m_duration

int GraphicsViewZoom::m_duration
private

◆ m_modifiers

Qt::KeyboardModifiers GraphicsViewZoom::m_modifiers
private

Definition at line 126 of file vmaingraphicsview.h.

Referenced by eventFilter(), and setModifiers().

◆ m_numScheduledHorizontalScrollings

qint32 GraphicsViewZoom::m_numScheduledHorizontalScrollings
private

_numScheduledHorizontalScrollings keep number scheduled horizontal scrollings.

Definition at line 137 of file vmaingraphicsview.h.

Referenced by horizontalScrollingTime(), and startHorizontalScrollings().

◆ m_numScheduledVerticalScrollings

qint32 GraphicsViewZoom::m_numScheduledVerticalScrollings
private

_numScheduledVerticalScrollings keep number scheduled vertical scrollings.

Definition at line 134 of file vmaingraphicsview.h.

Referenced by animFinished(), startVerticalScrollings(), and verticalScrollingTime().

◆ m_updateInterval

int GraphicsViewZoom::m_updateInterval
private

◆ m_view

QGraphicsView* GraphicsViewZoom::m_view
private

◆ m_zoomSpeedFactor

qreal GraphicsViewZoom::m_zoomSpeedFactor
private

Definition at line 127 of file vmaingraphicsview.h.

Referenced by eventFilter(), and setZoomSpeedFactor().

◆ pan

QGesture* GraphicsViewZoom::pan
private

Definition at line 147 of file vmaingraphicsview.h.

Referenced by gestureEvent().

◆ pinch

QGesture* GraphicsViewZoom::pinch
private

Definition at line 148 of file vmaingraphicsview.h.

Referenced by gestureEvent().

◆ scaleFactor

qreal GraphicsViewZoom::scaleFactor
private

Definition at line 151 of file vmaingraphicsview.h.

◆ targetScenePos

QPointF GraphicsViewZoom::targetScenePos
private

Definition at line 128 of file vmaingraphicsview.h.

Referenced by animFinished(), eventFilter(), and gentleZoom().

◆ targetViewPos

QPointF GraphicsViewZoom::targetViewPos
private

Definition at line 129 of file vmaingraphicsview.h.

Referenced by animFinished(), eventFilter(), and gentleZoom().

◆ verticalOffset

qreal GraphicsViewZoom::verticalOffset
private

Definition at line 150 of file vmaingraphicsview.h.

Referenced by panTriggered().

◆ verticalScrollAnim

QTimeLine* GraphicsViewZoom::verticalScrollAnim
private

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