Seamly2D
Code documentation
VMainGraphicsView Class Reference

The VMainGraphicsView class main scene view. More...

#include <vmaingraphicsview.h>

Inheritance diagram for VMainGraphicsView:
Collaboration diagram for VMainGraphicsView:

Public Slots

void zoomByScale (qreal scale)
 
void zoomIn ()
 
void zoomOut ()
 
void zoom100Percent ()
 
void zoomToFit ()
 
void zoomToRect (const QRectF &rect)
 
void updateView (const QTransform &transform)
 
void resetScrollBars ()
 
void resetScrollAnimations ()
 

Signals

void mouseRelease ()
 mouseRelease help catch mouse release event. More...
 
void itemClicked (QGraphicsItem *item)
 
void signalZoomScaleChanged (qreal scale)
 

Public Member Functions

 VMainGraphicsView (QWidget *parent=nullptr)
 VMainGraphicsView constructor. More...
 
void setShowToolOptions (bool value)
 
void allowRubberBand (bool value)
 
void zoomPanEnabled (bool value)
 
void zoomToAreaEnabled (bool value)
 
void setRubberBandColor (QRubberBand *band, const QColor &color)
 
void initScrollBars ()
 

Static Public Member Functions

static void NewSceneRect (QGraphicsScene *sc, QGraphicsView *view, QGraphicsItem *item=nullptr)
 NewSceneRect calculate scene rect what contains all items and doesn't less that size of scene view. More...
 
static QRectF SceneVisibleArea (QGraphicsView *view)
 
static qreal MinScale ()
 
static qreal MaxScale ()
 

Protected Member Functions

virtual void mousePressEvent (QMouseEvent *event) Q_DECL_OVERRIDE
 mousePressEvent handle mouse press events. More...
 
virtual void mouseMoveEvent (QMouseEvent *event) Q_DECL_OVERRIDE
 
virtual void mouseReleaseEvent (QMouseEvent *event) Q_DECL_OVERRIDE
 mouseReleaseEvent handle mouse release events. More...
 
virtual void mouseDoubleClickEvent (QMouseEvent *event) Q_DECL_OVERRIDE
 

Protected Attributes

QSharedPointer< QCursor > curMagnifier
 

Private Attributes

GraphicsViewZoomzoom
 
bool showToolProperties
 
bool showScrollBars
 
bool isallowRubberBand
 
bool isZoomToAreaActive
 
bool isRubberBandActive
 
bool isRubberBandColorSet
 
bool isZoomPanActive
 
bool isPanDragActive
 
QRubberBand * rubberBand
 
QRect * rubberBandRect
 
QPoint startPoint
 
QPoint endPoint
 
QPoint m_ptStartPos
 
QPoint cursorPos
 

Detailed Description

The VMainGraphicsView class main scene view.

Definition at line 158 of file vmaingraphicsview.h.

Constructor & Destructor Documentation

◆ VMainGraphicsView()

VMainGraphicsView::VMainGraphicsView ( QWidget *  parent = nullptr)
explicit

VMainGraphicsView constructor.

Parameters
parentparent object.

Definition at line 467 of file vmaingraphicsview.cpp.

References GraphicsViewZoom::zoomed().

Member Function Documentation

◆ allowRubberBand()

void VMainGraphicsView::allowRubberBand ( bool  value)

Definition at line 827 of file vmaingraphicsview.cpp.

References isallowRubberBand.

◆ initScrollBars()

void VMainGraphicsView::initScrollBars ( )

Definition at line 870 of file vmaingraphicsview.cpp.

References qApp, and showScrollBars.

Referenced by resetScrollBars().

◆ itemClicked

void VMainGraphicsView::itemClicked ( QGraphicsItem *  item)
signal

◆ MaxScale()

qreal VMainGraphicsView::MaxScale ( )
static

◆ MinScale()

qreal VMainGraphicsView::MinScale ( )
static

◆ mouseDoubleClickEvent()

void VMainGraphicsView::mouseDoubleClickEvent ( QMouseEvent *  event)
protectedvirtual

Definition at line 790 of file vmaingraphicsview.cpp.

References qApp.

◆ mouseMoveEvent()

void VMainGraphicsView::mouseMoveEvent ( QMouseEvent *  event)
protectedvirtual

◆ mousePressEvent()

void VMainGraphicsView::mousePressEvent ( QMouseEvent *  event)
protectedvirtual

mousePressEvent handle mouse press events.

Parameters
eventmouse press event.

Definition at line 631 of file vmaingraphicsview.cpp.

References isallowRubberBand, isPanDragActive, isRubberBandActive, isZoomPanActive, isZoomToAreaActive, itemClicked(), m_ptStartPos, rubberBand, showToolProperties, startPoint, and VSimpleCurve::Type.

◆ mouseRelease

void VMainGraphicsView::mouseRelease ( )
signal

mouseRelease help catch mouse release event.

Usefull when you need show dialog after working with tool visualization.

Referenced by MainWindow::InitScenes(), and mouseReleaseEvent().

◆ mouseReleaseEvent()

void VMainGraphicsView::mouseReleaseEvent ( QMouseEvent *  event)
protectedvirtual

mouseReleaseEvent handle mouse release events.

Parameters
eventmouse release event.

Definition at line 757 of file vmaingraphicsview.cpp.

References endPoint, isPanDragActive, isRubberBandActive, isRubberBandColorSet, mouseRelease(), rubberBand, rubberBandRect, and updateView().

◆ NewSceneRect()

◆ resetScrollAnimations

void VMainGraphicsView::resetScrollAnimations ( )
slot

Definition at line 906 of file vmaingraphicsview.cpp.

References GraphicsViewZoom::initScrollAnimations(), and zoom.

Referenced by MainWindow::Preferences().

◆ resetScrollBars

void VMainGraphicsView::resetScrollBars ( )
slot

Definition at line 900 of file vmaingraphicsview.cpp.

References initScrollBars().

Referenced by MainWindow::Preferences().

◆ SceneVisibleArea()

QRectF VMainGraphicsView::SceneVisibleArea ( QGraphicsView *  view)
static

◆ setRubberBandColor()

void VMainGraphicsView::setRubberBandColor ( QRubberBand *  band,
const QColor &  color 
)

Definition at line 618 of file vmaingraphicsview.cpp.

References isRubberBandColorSet.

Referenced by mouseMoveEvent().

◆ setShowToolOptions()

void VMainGraphicsView::setShowToolOptions ( bool  value)

Definition at line 821 of file vmaingraphicsview.cpp.

References showToolProperties.

◆ signalZoomScaleChanged

void VMainGraphicsView::signalZoomScaleChanged ( qreal  scale)
signal

◆ updateView

void VMainGraphicsView::updateView ( const QTransform &  transform)
slot

◆ zoom100Percent

void VMainGraphicsView::zoom100Percent ( )
slot

Definition at line 533 of file vmaingraphicsview.cpp.

References updateView().

Referenced by MainWindow::initToolsToolBar().

◆ zoomByScale

void VMainGraphicsView::zoomByScale ( qreal  scale)
slot

Definition at line 497 of file vmaingraphicsview.cpp.

References MaxScale(), MinScale(), and updateView().

Referenced by GroupsWidget::zoomToObject().

◆ zoomIn

void VMainGraphicsView::zoomIn ( )
slot

Definition at line 509 of file vmaingraphicsview.cpp.

References MaxScale(), and updateView().

Referenced by MainWindow::initToolsToolBar().

◆ zoomOut

void VMainGraphicsView::zoomOut ( )
slot

Definition at line 521 of file vmaingraphicsview.cpp.

References MinScale(), and updateView().

Referenced by MainWindow::initToolsToolBar().

◆ zoomPanEnabled()

void VMainGraphicsView::zoomPanEnabled ( bool  value)

Definition at line 602 of file vmaingraphicsview.cpp.

References isZoomPanActive, and isZoomToAreaActive.

◆ zoomToAreaEnabled()

void VMainGraphicsView::zoomToAreaEnabled ( bool  value)

Definition at line 585 of file vmaingraphicsview.cpp.

References curMagnifier, isZoomPanActive, and isZoomToAreaActive.

◆ zoomToFit

void VMainGraphicsView::zoomToFit ( )
slot

◆ zoomToRect

void VMainGraphicsView::zoomToRect ( const QRectF &  rect)
slot

Definition at line 555 of file vmaingraphicsview.cpp.

References MaxScale(), MinScale(), and updateView().

Referenced by zoomToFit().

Member Data Documentation

◆ curMagnifier

QSharedPointer<QCursor> VMainGraphicsView::curMagnifier
protected

Definition at line 207 of file vmaingraphicsview.h.

Referenced by zoomToAreaEnabled().

◆ cursorPos

QPoint VMainGraphicsView::cursorPos
private

Definition at line 225 of file vmaingraphicsview.h.

◆ endPoint

QPoint VMainGraphicsView::endPoint
private

Definition at line 223 of file vmaingraphicsview.h.

Referenced by mouseMoveEvent(), and mouseReleaseEvent().

◆ isallowRubberBand

bool VMainGraphicsView::isallowRubberBand
private

Definition at line 214 of file vmaingraphicsview.h.

Referenced by allowRubberBand(), and mousePressEvent().

◆ isPanDragActive

bool VMainGraphicsView::isPanDragActive
private

Definition at line 219 of file vmaingraphicsview.h.

Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().

◆ isRubberBandActive

bool VMainGraphicsView::isRubberBandActive
private

Definition at line 216 of file vmaingraphicsview.h.

Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().

◆ isRubberBandColorSet

bool VMainGraphicsView::isRubberBandColorSet
private

Definition at line 217 of file vmaingraphicsview.h.

Referenced by mouseMoveEvent(), mouseReleaseEvent(), and setRubberBandColor().

◆ isZoomPanActive

bool VMainGraphicsView::isZoomPanActive
private

Definition at line 218 of file vmaingraphicsview.h.

Referenced by mousePressEvent(), zoomPanEnabled(), and zoomToAreaEnabled().

◆ isZoomToAreaActive

bool VMainGraphicsView::isZoomToAreaActive
private

Definition at line 215 of file vmaingraphicsview.h.

Referenced by mousePressEvent(), zoomPanEnabled(), and zoomToAreaEnabled().

◆ m_ptStartPos

QPoint VMainGraphicsView::m_ptStartPos
private

Definition at line 224 of file vmaingraphicsview.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

◆ rubberBand

QRubberBand* VMainGraphicsView::rubberBand
private

Definition at line 220 of file vmaingraphicsview.h.

Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().

◆ rubberBandRect

QRect* VMainGraphicsView::rubberBandRect
private

Definition at line 221 of file vmaingraphicsview.h.

Referenced by mouseReleaseEvent().

◆ showScrollBars

bool VMainGraphicsView::showScrollBars
private

Definition at line 213 of file vmaingraphicsview.h.

Referenced by initScrollBars().

◆ showToolProperties

bool VMainGraphicsView::showToolProperties
private

Definition at line 212 of file vmaingraphicsview.h.

Referenced by mousePressEvent(), and setShowToolOptions().

◆ startPoint

QPoint VMainGraphicsView::startPoint
private

Definition at line 222 of file vmaingraphicsview.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

◆ zoom

GraphicsViewZoom* VMainGraphicsView::zoom
private

Definition at line 211 of file vmaingraphicsview.h.

Referenced by resetScrollAnimations().


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