![]() |
LibrePCB Developers Documentation
|
Asynchronously exports graphics to a QPainter. More...
#include <graphicsexport.h>
Inherits QObject.
Collaboration diagram for GraphicsExport:Classes | |
| struct | Result |
| struct | RunArgs |
Public Types | |
| typedef std::pair< std::shared_ptr< GraphicsPagePainter >, std::shared_ptr< GraphicsExportSettings > > | Page |
| typedef QList< Page > | Pages |
Signals | |
| void | previewReady (int index, const QSize &pageSize, const QRectF margins, std::shared_ptr< QPicture > picture) |
| void | savingFile (const librepcb::FilePath &filePath) |
| void | progress (int percent, int completed, int total) |
| void | succeeded () |
| void | failed (const QString &error) |
| void | imageCopiedToClipboard (const QImage &image, QClipboard::Mode mode) |
Public Member Functions | |
| GraphicsExport (QObject *parent=nullptr) noexcept | |
| GraphicsExport (const GraphicsExport &other)=delete | |
| ~GraphicsExport () noexcept | |
| void | setDocumentName (const QString &name) noexcept |
| Set the document name used for printing, PDF and SVG export. | |
| void | startPreview (const Pages &pages) noexcept |
| Start creating previews asynchronously. | |
| void | startExport (const Pages &pages, const FilePath &filePath) noexcept |
| Start exporting to a file or clipboard asynchronously. | |
| void | startPrint (const Pages &pages, const QString &printerName, QPrinter::DuplexMode duplex, int copies) noexcept |
| Start printing to a printer asynchronously. | |
| Result | waitForFinished () noexcept |
| Wait (block) until the preview/export/print is finished. | |
| void | cancel () noexcept |
| Cancel the current job. | |
| GraphicsExport & | operator= (const GraphicsExport &rhs)=delete |
Static Public Member Functions | |
| static QStringList | getSupportedExtensions () noexcept |
| Get all supported file extensions for startExport() | |
| static QStringList | getSupportedImageExtensions () noexcept |
| Get all supported image file extensions for startExport() | |
Private Member Functions | |
| Result | run (RunArgs args) noexcept |
Static Private Member Functions | |
| static QTransform | getSourceTransformation (const GraphicsExportSettings &settings) noexcept |
| static QRectF | calcSourceRect (const GraphicsPagePainter &page, const GraphicsExportSettings &settings) noexcept |
| static QPageLayout::Orientation | getOrientation (const QSizeF &size) noexcept |
Private Attributes | |
| QString | mCreator |
| QString | mDocumentName |
| QFuture< Result > | mFuture |
| bool | mAbort |
Asynchronously exports graphics to a QPainter.
Used for graphics printing, PDF export, SVG export etc. without blocking the main thread.
| typedef std::pair<std::shared_ptr<GraphicsPagePainter>, std::shared_ptr<GraphicsExportSettings> > Page |
|
noexcept |
Here is the call graph for this function:
|
delete |
|
noexcept |
Here is the call graph for this function:
|
inlinenoexcept |
Set the document name used for printing, PDF and SVG export.
| name | Document name. |
Here is the caller graph for this function:
|
noexcept |
Start creating previews asynchronously.
The signal previewReady() will be emitted from a worker thread for each processed page.
| pages | The pages to create the preview of. |
Here is the call graph for this function:Start exporting to a file or clipboard asynchronously.
The supported file type will be determined automatically by the file extension. Supported file types are pdf, svg and all supported file extensions of QImage. See also getSupportedExtensions().
The signals::savingFile() will be emitted from a worker thread for each file created.
| pages | The pages to export. |
| filePath | Export file path. If invalid, pixmaps will be copied into the clipboard. If multiple pages are exported, the page number will automatically be appended to the filename. |
Here is the call graph for this function:
Here is the caller graph for this function:
|
noexcept |
Start printing to a printer asynchronously.
| pages | The pages to export. |
| printerName | Name of the printer to use. |
| duplex | The duplex mode to use. |
| copies | Number of copies to print. |
Here is the call graph for this function:
|
noexcept |
Wait (block) until the preview/export/print is finished.
Here is the caller graph for this function:
|
noexcept |
Cancel the current job.
Here is the caller graph for this function:
|
delete |
|
staticnoexcept |
Get all supported file extensions for startExport()
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticnoexcept |
Get all supported image file extensions for startExport()
Here is the caller graph for this function:
|
signal |
Here is the caller graph for this function:
|
signal |
|
signal |
|
signal |
Here is the caller graph for this function:
|
signal |
|
signal |
Here is the caller graph for this function:
|
privatenoexcept |
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprivatenoexcept |
|
staticprivatenoexcept |
|
staticprivatenoexcept |
|
private |
|
private |
|
private |
|
private |