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

Dialog (GUI) to configure the background image of a 2D view. More...

#include <backgroundimagesetupdialog.h>

+ Inheritance diagram for BackgroundImageSetupDialog:
+ Collaboration diagram for BackgroundImageSetupDialog:

Public Types

enum class  State
 

Public Member Functions

 BackgroundImageSetupDialog ()=delete
 
 BackgroundImageSetupDialog (const BackgroundImageSetupDialog &other)=delete
 
 BackgroundImageSetupDialog (const QString &settingsPrefix, QWidget *parent=nullptr) noexcept
 
 ~BackgroundImageSetupDialog () noexcept
 
const QImage & getImage () const noexcept
 
const AnglegetRotation () const noexcept
 
const QList< std::pair< QPointF, Point > > & getReferences () const noexcept
 
void setData (const QImage &image, const Angle &rotation, const QList< std::pair< QPointF, Point > > &references) noexcept
 
BackgroundImageSetupDialogoperator= (const BackgroundImageSetupDialog &rhs)=delete
 

Private Member Functions

void keyPressEvent (QKeyEvent *event) noexcept override
 
bool graphicsViewEventHandler (QEvent *event) noexcept override
 The event handler method.
 
void startScreenshot () noexcept
 
void screenshotCountdownTick () noexcept
 
void takeScreenshot () noexcept
 
void pasteFromClipboard () noexcept
 
void loadFromFile () noexcept
 
void updateUi (QString msg=QString()) noexcept
 
void fitImageInView () noexcept
 
void updateAnchors () noexcept
 
void updateStatusMsg () noexcept
 
- Private Member Functions inherited from IF_GraphicsViewEventHandler
 IF_GraphicsViewEventHandler () noexcept
 
virtual ~IF_GraphicsViewEventHandler () noexcept
 

Static Private Member Functions

static QImage cropImage (const QImage &img, const QPainterPath &p) noexcept
 

Private Attributes

QScopedPointer< Ui::BackgroundImageSetupDialog > mUi
 
const QString mSettingsPrefix
 
State mState
 
QImage mImage
 
Angle mRotation
 
QList< std::pair< QPointF, Point > > mLoadedReferences
 
QList< std::pair< QPointF, Point > > mReferences
 
QPointer< QScreen > mScreen
 
int mCountdownSecs
 
QScopedPointer< QWidget > mRotateWidget
 
QScopedPointer< QGraphicsPixmapItem > mImageGraphicsItem
 
std::shared_ptr< QGraphicsPathItem > mCursorGraphicsItem
 
QScopedPointer< QGraphicsPathItem > mCropGraphicsItem
 
QList< std::shared_ptr< QGraphicsPathItem > > mReferenceGraphicsItems
 
QList< std::shared_ptr< QGraphicsLineItem > > mReferenceLineGraphicsItems
 
QList< std::shared_ptr< QWidget > > mReferenceWidgets
 

Detailed Description

Dialog (GUI) to configure the background image of a 2D view.

Member Enumeration Documentation

◆ State

enum class State
strong
Enumerator
Idle 
Crop 
Rotate 
SelectRef1 
SelectRef2 

Constructor & Destructor Documentation

◆ BackgroundImageSetupDialog() [1/3]

◆ BackgroundImageSetupDialog() [2/3]

◆ BackgroundImageSetupDialog() [3/3]

BackgroundImageSetupDialog ( const QString &  settingsPrefix,
QWidget *  parent = nullptr 
)
explicitnoexcept
+ Here is the call graph for this function:

◆ ~BackgroundImageSetupDialog()

Member Function Documentation

◆ getImage()

const QImage & getImage ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getRotation()

const Angle & getRotation ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getReferences()

const QList< std::pair< QPointF, Point > > & getReferences ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ setData()

void setData ( const QImage &  image,
const Angle rotation,
const QList< std::pair< QPointF, Point > > &  references 
)
noexcept
+ Here is the caller graph for this function:

◆ operator=()

BackgroundImageSetupDialog & operator= ( const BackgroundImageSetupDialog rhs)
delete

◆ keyPressEvent()

void keyPressEvent ( QKeyEvent *  event)
overrideprivatenoexcept

◆ graphicsViewEventHandler()

bool graphicsViewEventHandler ( QEvent *  event)
overrideprivatevirtualnoexcept

The event handler method.

Implements IF_GraphicsViewEventHandler.

◆ startScreenshot()

void startScreenshot ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ screenshotCountdownTick()

void screenshotCountdownTick ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ takeScreenshot()

void takeScreenshot ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pasteFromClipboard()

void pasteFromClipboard ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadFromFile()

void loadFromFile ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateUi()

void updateUi ( QString  msg = QString())
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fitImageInView()

void fitImageInView ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateAnchors()

void updateAnchors ( )
privatenoexcept
+ Here is the caller graph for this function:

◆ updateStatusMsg()

void updateStatusMsg ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cropImage()

QImage cropImage ( const QImage &  img,
const QPainterPath &  p 
)
staticprivatenoexcept
+ Here is the call graph for this function:

Member Data Documentation

◆ mUi

QScopedPointer<Ui::BackgroundImageSetupDialog> mUi
private

◆ mSettingsPrefix

const QString mSettingsPrefix
private

◆ mState

State mState
private

◆ mImage

QImage mImage
private

◆ mRotation

Angle mRotation
private

◆ mLoadedReferences

QList<std::pair<QPointF, Point> > mLoadedReferences
private

◆ mReferences

QList<std::pair<QPointF, Point> > mReferences
private

◆ mScreen

QPointer<QScreen> mScreen
private

◆ mCountdownSecs

int mCountdownSecs
private

◆ mRotateWidget

QScopedPointer<QWidget> mRotateWidget
private

◆ mImageGraphicsItem

QScopedPointer<QGraphicsPixmapItem> mImageGraphicsItem
private

◆ mCursorGraphicsItem

std::shared_ptr<QGraphicsPathItem> mCursorGraphicsItem
private

◆ mCropGraphicsItem

QScopedPointer<QGraphicsPathItem> mCropGraphicsItem
private

◆ mReferenceGraphicsItems

QList<std::shared_ptr<QGraphicsPathItem> > mReferenceGraphicsItems
private

◆ mReferenceLineGraphicsItems

QList<std::shared_ptr<QGraphicsLineItem> > mReferenceLineGraphicsItems
private

◆ mReferenceWidgets

QList<std::shared_ptr<QWidget> > mReferenceWidgets
private

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