LibrePCB Developers Documentation
Loading...
Searching...
No Matches
SlintGraphicsView Class Referencefinal

The SlintGraphicsView class. More...

#include <slintgraphicsview.h>

Inherits QObject.

+ Collaboration diagram for SlintGraphicsView:

Classes

struct  Projection
 

Signals

void stateChanged ()
 
void transformChanged ()
 

Public Member Functions

 SlintGraphicsView (const QRectF &defaultSceneRect, const QMarginsF &defaultMargins, QObject *parent=nullptr) noexcept
 
 SlintGraphicsView (const SlintGraphicsView &other)=delete
 
virtual ~SlintGraphicsView () noexcept
 
bool isPanning () const noexcept
 
QPainterPath calcPosWithTolerance (const Point &pos, qreal multiplier) const noexcept
 
Point mapToScenePos (const QPointF &pos, qreal devicePixelRatio) const noexcept
 
void setUseOpenGl (bool use) noexcept
 
void setEventHandler (IF_GraphicsViewEventHandler *obj) noexcept
 
slint::Image render (GraphicsScene &scene, float width, float height) noexcept
 
bool pointerEvent (const QPointF &pos, slint::private_api::PointerEvent e) noexcept
 
bool scrollEvent (const QPointF &pos, slint::private_api::PointerScrollEvent e) noexcept
 
bool keyEvent (const slint::private_api::KeyEvent &e) noexcept
 
void scrollLeft () noexcept
 
void scrollRight () noexcept
 
void scrollUp () noexcept
 
void scrollDown () noexcept
 
void zoomIn () noexcept
 
void zoomOut () noexcept
 
void zoomToSceneRect (const QRectF &r) noexcept
 
SlintGraphicsViewoperator= (const SlintGraphicsView &rhs)=delete
 

Static Public Member Functions

static QRectF defaultSymbolSceneRect () noexcept
 
static QRectF defaultFootprintSceneRect () noexcept
 
static QRectF defaultSchematicSceneRect () noexcept
 
static QRectF defaultBoardSceneRect () noexcept
 
static QMarginsF defaultMargins () noexcept
 
static QMarginsF defaultEditorMargins () noexcept
 

Private Member Functions

void scroll (const QPointF &delta) noexcept
 
void zoom (const QPointF &center, qreal factor) noexcept
 
void smoothTo (const Projection &projection) noexcept
 
bool applyProjection (const Projection &projection) noexcept
 
QRectF validateSceneRect (const QRectF &r) const noexcept
 

Private Attributes

const QRectF mDefaultSceneRect
 
const QMarginsF mDefaultMargins
 
IF_GraphicsViewEventHandlermEventHandler
 
std::unique_ptr< QOffscreenSurface > mGlSurface
 
std::unique_ptr< QOpenGLContext > mGlContext
 
std::unique_ptr< QOpenGLFramebufferObject > mGlFbo
 
QString mGlError
 
Projection mProjection
 
QSizeF mViewSize
 
GraphicsSceneMouseEvent mMouseEvent
 
QDeadlineTimer mLeftMouseButtonDoubleClickTimer
 
bool mPanning = false
 
QPointF mPanningStartScreenPos
 
QPointF mPanningStartScenePos
 
Projection mAnimationDataStart
 
Projection mAnimationDataDelta
 
std::unique_ptr< QVariantAnimation > mAnimation
 

Detailed Description

The SlintGraphicsView class.

Constructor & Destructor Documentation

◆ SlintGraphicsView() [1/2]

SlintGraphicsView ( const QRectF &  defaultSceneRect,
const QMarginsF &  defaultMargins,
QObject *  parent = nullptr 
)
explicitnoexcept

◆ SlintGraphicsView() [2/2]

SlintGraphicsView ( const SlintGraphicsView other)
delete

◆ ~SlintGraphicsView()

~SlintGraphicsView ( )
virtualnoexcept

Member Function Documentation

◆ isPanning()

bool isPanning ( ) const
inlinenoexcept

◆ calcPosWithTolerance()

QPainterPath calcPosWithTolerance ( const Point pos,
qreal  multiplier 
) const
noexcept

◆ mapToScenePos()

Point mapToScenePos ( const QPointF &  pos,
qreal  devicePixelRatio 
) const
noexcept
+ Here is the call graph for this function:

◆ setUseOpenGl()

void setUseOpenGl ( bool  use)
noexcept
+ Here is the caller graph for this function:

◆ setEventHandler()

void setEventHandler ( IF_GraphicsViewEventHandler obj)
noexcept

◆ render()

slint::Image render ( GraphicsScene scene,
float  width,
float  height 
)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pointerEvent()

bool pointerEvent ( const QPointF &  pos,
slint::private_api::PointerEvent  e 
)
noexcept
+ Here is the call graph for this function:

◆ scrollEvent()

bool scrollEvent ( const QPointF &  pos,
slint::private_api::PointerScrollEvent  e 
)
noexcept

◆ keyEvent()

bool keyEvent ( const slint::private_api::KeyEvent &  e)
noexcept
+ Here is the call graph for this function:

◆ scrollLeft()

void scrollLeft ( )
noexcept
+ Here is the call graph for this function:

◆ scrollRight()

void scrollRight ( )
noexcept
+ Here is the call graph for this function:

◆ scrollUp()

void scrollUp ( )
noexcept
+ Here is the call graph for this function:

◆ scrollDown()

void scrollDown ( )
noexcept
+ Here is the call graph for this function:

◆ zoomIn()

void zoomIn ( )
noexcept
+ Here is the call graph for this function:

◆ zoomOut()

void zoomOut ( )
noexcept
+ Here is the call graph for this function:

◆ zoomToSceneRect()

void zoomToSceneRect ( const QRectF &  r)
noexcept

◆ defaultSymbolSceneRect()

QRectF defaultSymbolSceneRect ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ defaultFootprintSceneRect()

QRectF defaultFootprintSceneRect ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ defaultSchematicSceneRect()

QRectF defaultSchematicSceneRect ( )
staticnoexcept
+ Here is the call graph for this function:

◆ defaultBoardSceneRect()

QRectF defaultBoardSceneRect ( )
staticnoexcept
+ Here is the call graph for this function:

◆ defaultMargins()

QMarginsF defaultMargins ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ defaultEditorMargins()

QMarginsF defaultEditorMargins ( )
staticnoexcept

◆ operator=()

SlintGraphicsView & operator= ( const SlintGraphicsView rhs)
delete

◆ stateChanged

void stateChanged ( )
signal
+ Here is the caller graph for this function:

◆ transformChanged

void transformChanged ( )
signal
+ Here is the caller graph for this function:

◆ scroll()

void scroll ( const QPointF &  delta)
privatenoexcept
+ Here is the caller graph for this function:

◆ zoom()

void zoom ( const QPointF &  center,
qreal  factor 
)
privatenoexcept
+ Here is the caller graph for this function:

◆ smoothTo()

void smoothTo ( const Projection projection)
privatenoexcept

◆ applyProjection()

bool applyProjection ( const Projection projection)
privatenoexcept

◆ validateSceneRect()

QRectF validateSceneRect ( const QRectF &  r) const
privatenoexcept

Member Data Documentation

◆ mDefaultSceneRect

const QRectF mDefaultSceneRect
private

◆ mDefaultMargins

const QMarginsF mDefaultMargins
private

◆ mEventHandler

IF_GraphicsViewEventHandler* mEventHandler
private

◆ mGlSurface

std::unique_ptr<QOffscreenSurface> mGlSurface
private

◆ mGlContext

std::unique_ptr<QOpenGLContext> mGlContext
private

◆ mGlFbo

std::unique_ptr<QOpenGLFramebufferObject> mGlFbo
private

◆ mGlError

QString mGlError
private

◆ mProjection

Projection mProjection
private

◆ mViewSize

QSizeF mViewSize
private

◆ mMouseEvent

GraphicsSceneMouseEvent mMouseEvent
private

◆ mLeftMouseButtonDoubleClickTimer

QDeadlineTimer mLeftMouseButtonDoubleClickTimer
private

◆ mPanning

bool mPanning = false
private

◆ mPanningStartScreenPos

QPointF mPanningStartScreenPos
private

◆ mPanningStartScenePos

QPointF mPanningStartScenePos
private

◆ mAnimationDataStart

Projection mAnimationDataStart
private

◆ mAnimationDataDelta

Projection mAnimationDataDelta
private

◆ mAnimation

std::unique_ptr<QVariantAnimation> mAnimation
private

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