LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GraphicsView Class Referencefinal

The GraphicsView class. More...

#include <graphicsview.h>

Inherits QGraphicsView.

+ Collaboration diagram for GraphicsView:

Public Slots

void zoomIn () noexcept
 
void zoomOut () noexcept
 
void zoomAll () noexcept
 

Signals

void cursorScenePositionChanged (const Point &pos)
 Cursor scene position changed signal. More...
 

Public Member Functions

 GraphicsView (QWidget *parent=nullptr, IF_GraphicsViewEventHandler *eventHandler=nullptr) noexcept
 
 ~GraphicsView () noexcept
 
GraphicsScenegetScene () const noexcept
 
QRectF getVisibleSceneRect () const noexcept
 
bool getUseOpenGl () const noexcept
 
const GridPropertiesgetGridProperties () const noexcept
 
void setUseOpenGl (bool useOpenGl) noexcept
 
void setGridProperties (const GridProperties &properties) noexcept
 
void setScene (GraphicsScene *scene) noexcept
 
void setVisibleSceneRect (const QRectF &rect) noexcept
 
void setOriginCrossVisible (bool visible) noexcept
 
void setEventHandlerObject (IF_GraphicsViewEventHandler *eventHandler) noexcept
 
Point mapGlobalPosToScenePos (const QPoint &globalPosPx, bool boundToView, bool mapToGrid) const noexcept
 
void handleMouseWheelEvent (QGraphicsSceneWheelEvent *event) noexcept
 

Private Slots

void zoomAnimationValueChanged (const QVariant &value) noexcept
 

Private Member Functions

 GraphicsView (const GraphicsView &other)=delete
 
GraphicsViewoperator= (const GraphicsView &rhs)=delete
 
bool eventFilter (QObject *obj, QEvent *event)
 
void drawBackground (QPainter *painter, const QRectF &rect)
 
void drawForeground (QPainter *painter, const QRectF &rect)
 

Private Attributes

IF_GraphicsViewEventHandlermEventHandlerObject
 
GraphicsScenemScene
 
QVariantAnimation * mZoomAnimation
 
GridPropertiesmGridProperties
 
bool mOriginCrossVisible
 
bool mUseOpenGl
 
volatile bool mPanningActive
 
QCursor mCursorBeforePanning
 

Static Private Attributes

static constexpr qreal sZoomStepFactor = 1.3
 

Detailed Description

The GraphicsView class.

Constructor & Destructor Documentation

GraphicsView ( QWidget *  parent = nullptr,
IF_GraphicsViewEventHandler eventHandler = nullptr 
)
explicitnoexcept

+ Here is the call graph for this function:

~GraphicsView ( )
noexcept
GraphicsView ( const GraphicsView other)
privatedelete

Member Function Documentation

GraphicsScene* getScene ( ) const
inlinenoexcept
QRectF getVisibleSceneRect ( ) const
noexcept

+ Here is the caller graph for this function:

bool getUseOpenGl ( ) const
inlinenoexcept
const GridProperties& getGridProperties ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

void setUseOpenGl ( bool  useOpenGl)
noexcept

+ Here is the caller graph for this function:

void setGridProperties ( const GridProperties properties)
noexcept

+ Here is the caller graph for this function:

void setScene ( GraphicsScene scene)
noexcept
void setVisibleSceneRect ( const QRectF &  rect)
noexcept
void setOriginCrossVisible ( bool  visible)
noexcept
void setEventHandlerObject ( IF_GraphicsViewEventHandler eventHandler)
noexcept
Point mapGlobalPosToScenePos ( const QPoint &  globalPosPx,
bool  boundToView,
bool  mapToGrid 
) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void handleMouseWheelEvent ( QGraphicsSceneWheelEvent *  event)
noexcept

+ Here is the caller graph for this function:

void zoomIn ( )
slotnoexcept
void zoomOut ( )
slotnoexcept
void zoomAll ( )
slotnoexcept

+ Here is the call graph for this function:

void cursorScenePositionChanged ( const Point pos)
signal

Cursor scene position changed signal.

Parameters
posThe new cursor position (not mapped to grid!)

+ Here is the caller graph for this function:

void zoomAnimationValueChanged ( const QVariant &  value)
privateslotnoexcept

+ Here is the caller graph for this function:

GraphicsView& operator= ( const GraphicsView rhs)
privatedelete
bool eventFilter ( QObject *  obj,
QEvent *  event 
)
private

+ Here is the call graph for this function:

void drawBackground ( QPainter *  painter,
const QRectF &  rect 
)
private

+ Here is the call graph for this function:

void drawForeground ( QPainter *  painter,
const QRectF &  rect 
)
private

+ Here is the call graph for this function:

Member Data Documentation

IF_GraphicsViewEventHandler* mEventHandlerObject
private
GraphicsScene* mScene
private
QVariantAnimation* mZoomAnimation
private
GridProperties* mGridProperties
private
bool mOriginCrossVisible
private
bool mUseOpenGl
private
volatile bool mPanningActive
private
QCursor mCursorBeforePanning
private
constexpr qreal sZoomStepFactor = 1.3
staticprivate

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