LibrePCB Developers Documentation
GraphicsExportWidget Class Referencefinal

Like QGraphicsExportWidget, just better. More...

#include <graphicsexportpreviewwidget.h>

Inherits QWidget.

+ Collaboration diagram for GraphicsExportWidget:

Classes

class  PageItem
 

Public Member Functions

 GraphicsExportWidget (const GraphicsExportWidget &other)=delete
 
 GraphicsExportWidget (QWidget *parent=nullptr) noexcept
 
 ~GraphicsExportWidget () noexcept
 
void setShowPageNumbers (bool show) noexcept
 
void setShowResolution (bool show) noexcept
 
void setNumberOfPages (int number) noexcept
 
void setPageContent (int index, const QSize &pageSize, const QRectF margins, std::shared_ptr< QPicture > picture) noexcept
 
GraphicsExportWidgetoperator= (const GraphicsExportWidget &rhs)=delete
 

Protected Member Functions

void resizeEvent (QResizeEvent *e) noexcept override
 
void showEvent (QShowEvent *e) noexcept override
 

Private Member Functions

void updateScale () noexcept
 
void updateItemPositions () noexcept
 

Private Attributes

QScopedPointer< QGraphicsView > mView
 
QScopedPointer< QGraphicsScene > mScene
 
QVector< std::shared_ptr< PageItem > > mItems
 
bool mShowPageNumbers
 
bool mShowResolution
 

Detailed Description

Like QGraphicsExportWidget, just better.

Main differences to QGraphicsExportWidget:

  • Does not enforce a cumbersome software architecture, making this widget easier to integrate (passing QImage objects instead of implementing a callback which draws on a QPrinter)
  • Supports per-page size, i.e. each page can have a different size
  • Draws page margins and page numbers
  • Less configurable, supports only the configuration we need for LibrePCB

Constructor & Destructor Documentation

◆ GraphicsExportWidget() [1/2]

GraphicsExportWidget ( const GraphicsExportWidget other)
delete

◆ GraphicsExportWidget() [2/2]

GraphicsExportWidget ( QWidget *  parent = nullptr)
explicitnoexcept

◆ ~GraphicsExportWidget()

~GraphicsExportWidget ( )
noexcept

Member Function Documentation

◆ setShowPageNumbers()

void setShowPageNumbers ( bool  show)
noexcept

◆ setShowResolution()

void setShowResolution ( bool  show)
noexcept

◆ setNumberOfPages()

void setNumberOfPages ( int  number)
noexcept
+ Here is the call graph for this function:

◆ setPageContent()

void setPageContent ( int  index,
const QSize &  pageSize,
const QRectF  margins,
std::shared_ptr< QPicture >  picture 
)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

GraphicsExportWidget & operator= ( const GraphicsExportWidget rhs)
delete

◆ resizeEvent()

void resizeEvent ( QResizeEvent *  e)
overrideprotectednoexcept
+ Here is the call graph for this function:

◆ showEvent()

void showEvent ( QShowEvent *  e)
overrideprotectednoexcept
+ Here is the call graph for this function:

◆ updateScale()

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

◆ updateItemPositions()

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

Member Data Documentation

◆ mView

QScopedPointer<QGraphicsView> mView
private

◆ mScene

QScopedPointer<QGraphicsScene> mScene
private

◆ mItems

QVector<std::shared_ptr<PageItem> > mItems
private

◆ mShowPageNumbers

bool mShowPageNumbers
private

◆ mShowResolution

bool mShowResolution
private

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