34#include <NDEVR/Vector.h>
35#include <NDEVR/Buffer.h>
36#include <NDEVR/Pointer.h>
44class QPageSetupDialog;
45class QPrintPreviewWidget;
155 void fitComboChanged();
156 void settingsChanged();
159 void Print(QPrinter *printer);
160 void choosePrinterAccepted(QPrinter* printer);
162 void setToDefaultPrinter();
163 void printImages(QPrinter* printer);
165 void printWidget(QWidget* widget, QPainter& painter, QPoint offset);
180 Ui::PrintPreviewUI*
ui;
The equivelent of std::vector but with a bit more control.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
QPageSetupDialog * pageSetupDialog()
Returns the page setup dialog.
Button * m_print_button
The print action button.
QPrintPreviewWidget * m_print_preview
The preview rendering widget.
bool isZoomMode() const
Returns whether zoom mode is active.
bool zoomInToFit() const
Returns whether zoom-to-fit is enabled.
void setPrintFont(const QFont &font)
Sets the font used for print rendering.
void setImages(const Buffer< QImage > &images, const Buffer< QWidget * > &custom_print_options=Buffer< QWidget * >())
Sets the images to print.
void resetPreferredSize()
Resets the preferred page size to the printer default.
~PrintPreview()
Destroys the PrintPreview and releases printer resources.
PrintPreview(QWidget *parent=nullptr)
Constructs a PrintPreview widget.
void printWidgets(const DynamicPointer< WidgetIterator > &reports, const Buffer< QWidget * > &custom_print_options=Buffer< QWidget * >())
Prints widgets provided by a WidgetIterator.
Ui::PrintPreviewUI * ui
The auto-generated UI form.
void setImage(uint04 index, const QImage &image, const Buffer< QWidget * > &custom_print_options=Buffer< QWidget * >())
Sets a specific image at the given index.
void printWidget(QWidget *widget, const Buffer< QWidget * > &custom_print_options=Buffer< QWidget * >())
Prints a single widget.
void zoomModeChangedSignal()
Emitted when the zoom mode setting changes.
virtual QSize sizeHint() const override
Returns the preferred size hint for this widget.
void clearImages()
Clears all stored images from the print queue.
bool m_is_virtual_printer
Whether the selected printer is a virtual printer.
Buffer< QWidget * > m_custom_print_settings_widgets
Custom widgets for print settings.
bool m_is_setting_font
Whether a font change is in progress.
QPrinter * m_printer
The active printer device.
Button * m_page_settings_button
The page settings button.
void setCustomPrintSettingsWidgets(const Buffer< QWidget * > &widgets)
Sets custom widgets to display in the print settings area.
DynamicPointer< WidgetIterator > m_widgets
The widget iterator for multi-page widget printing.
static PrintPreview * PrintPreviewWidget()
Creates or returns the singleton PrintPreview widget.
Vector< 2, fltp08 > customPercent() const
Returns the custom scaling percentage for width and height.
bool isCustomPercent() const
Returns whether a custom scaling percentage is being used.
Vector< 2, uint04 > scaledPageResolution() const
Returns the page resolution after applying the current scale.
Vector< 2, uint04 > pageResolution() const
Returns the current page resolution in pixels.
QPrintDialog * printSetupDialog()
Returns the print setup dialog.
void pageResolutionChangedSignal(Vector< 2, uint04 > pixel_size)
Emitted when the page resolution changes.
void finishedSignal()
Emitted when the print preview dialog is finished.
QPrintDialog * m_print_setup_dialog
The printer selection dialog.
void setPreferredSize(QSize preferred_size)
Sets the preferred page size for printing.
void printedSignal()
Emitted after a print operation completes.
QPageSetupDialog * m_page_setup_dialog
The page layout setup dialog.
QPalette printPalette() const
Returns the palette used for print rendering.
QFont m_print_font
The font used for printing.
Button * m_print_settings_button
The printer settings button.
Vector< 2, uint04 > m_last_resolution
The last known page resolution.
static PrintPreview * PrintPreviewWidget(const Buffer< QImage > &images)
Creates or returns the singleton PrintPreview widget with the given images.
void printWidgets(const Buffer< QWidget * > &widgets, const Buffer< QWidget * > &custom_print_options=Buffer< QWidget * >())
Prints multiple widgets.
Buffer< QImage > m_images
The images queued for printing.
static bool SystemHasPrinters()
Checks whether the system has any configured printers.
bool event(QEvent *event) override
Handles widget events.
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...