![]() |
NDEVR
API Documentation
|
A dialog that shows a PrintPreview of a given widgets, reports, or images. More...
Public Member Functions | |
| PrintPreview (QWidget *parent=nullptr) | |
| Constructs a PrintPreview widget. | |
| ~PrintPreview () | |
| Destroys the PrintPreview and releases printer resources. | |
| void | clearImages () |
| Clears all stored images from the print queue. | |
| Vector< 2, fltp08 > | customPercent () const |
| Returns the custom scaling percentage for width and height. | |
| bool | event (QEvent *event) override |
| Handles widget events. | |
| void | finishedSignal () |
| Emitted when the print preview dialog is finished. | |
| bool | isCustomPercent () const |
| Returns whether a custom scaling percentage is being used. | |
| bool | isZoomMode () const |
| Returns whether zoom mode is active. | |
| Vector< 2, uint04 > | pageResolution () const |
| Returns the current page resolution in pixels. | |
| void | pageResolutionChangedSignal (Vector< 2, uint04 > pixel_size) |
| Emitted when the page resolution changes. | |
| QPageSetupDialog * | pageSetupDialog () |
| Returns the page setup dialog. | |
| void | printedSignal () |
| Emitted after a print operation completes. | |
| QPalette | printPalette () const |
| Returns the palette used for print rendering. | |
| QPrintDialog * | printSetupDialog () |
| Returns the print setup dialog. | |
| void | printWidget (QWidget *widget, const Buffer< QWidget * > &custom_print_options=Buffer< QWidget * >()) |
| Prints a single widget. | |
| void | printWidgets (const Buffer< QWidget * > &widgets, const Buffer< QWidget * > &custom_print_options=Buffer< QWidget * >()) |
| Prints multiple widgets. | |
| void | printWidgets (const DynamicPointer< WidgetIterator > &reports, const Buffer< QWidget * > &custom_print_options=Buffer< QWidget * >()) |
| Prints widgets provided by a WidgetIterator. | |
| void | resetPreferredSize () |
| Resets the preferred page size to the printer default. | |
| Vector< 2, uint04 > | scaledPageResolution () const |
| Returns the page resolution after applying the current scale. | |
| void | setCustomPrintSettingsWidgets (const Buffer< QWidget * > &widgets) |
| Sets custom widgets to display in the print settings area. | |
| void | setImage (uint04 index, const QImage &image, const Buffer< QWidget * > &custom_print_options=Buffer< QWidget * >()) |
| Sets a specific image at the given index. | |
| void | setImages (const Buffer< QImage > &images, const Buffer< QWidget * > &custom_print_options=Buffer< QWidget * >()) |
| Sets the images to print. | |
| void | setPreferredSize (QSize preferred_size) |
| Sets the preferred page size for printing. | |
| void | setPrintFont (const QFont &font) |
| Sets the font used for print rendering. | |
| virtual QSize | sizeHint () const override |
| Returns the preferred size hint for this widget. | |
| bool | zoomInToFit () const |
| Returns whether zoom-to-fit is enabled. | |
| void | zoomModeChangedSignal () |
| Emitted when the zoom mode setting changes. | |
Static Public Member Functions | |
| static PrintPreview * | PrintPreviewWidget () |
| Creates or returns the singleton PrintPreview widget. | |
| static PrintPreview * | PrintPreviewWidget (const Buffer< QImage > &images) |
| Creates or returns the singleton PrintPreview widget with the given images. | |
| static bool | SystemHasPrinters () |
| Checks whether the system has any configured printers. | |
Protected Attributes | |
| Buffer< QWidget * > | m_custom_print_settings_widgets |
| Custom widgets for print settings. | |
| Buffer< QImage > | m_images |
| The images queued for printing. | |
| bool | m_is_setting_font |
| Whether a font change is in progress. | |
| bool | m_is_virtual_printer = false |
| Whether the selected printer is a virtual printer. | |
| Vector< 2, uint04 > | m_last_resolution |
| The last known page resolution. | |
| Button * | m_page_settings_button |
| The page settings button. | |
| QPageSetupDialog * | m_page_setup_dialog |
| The page layout setup dialog. | |
| Button * | m_print_button |
| The print action button. | |
| QFont | m_print_font |
| The font used for printing. | |
| QPrintPreviewWidget * | m_print_preview |
| The preview rendering widget. | |
| Button * | m_print_settings_button |
| The printer settings button. | |
| QPrintDialog * | m_print_setup_dialog |
| The printer selection dialog. | |
| QPrinter * | m_printer |
| The active printer device. | |
| DynamicPointer< WidgetIterator > | m_widgets |
| The widget iterator for multi-page widget printing. | |
| Ui::PrintPreviewUI * | ui |
| The auto-generated UI form. | |
A dialog that shows a PrintPreview of a given widgets, reports, or images.
User can modify print settings and print directly from this dialog.
Definition at line 55 of file PrintPreview.h.
| PrintPreview::PrintPreview | ( | QWidget * | parent = nullptr | ) |
Constructs a PrintPreview widget.
| [in] | parent | The optional parent widget. |
Referenced by PrintPreviewWidget(), and PrintPreviewWidget().
Returns the custom scaling percentage for width and height.
|
override |
| bool PrintPreview::isCustomPercent | ( | ) | const |
Returns whether a custom scaling percentage is being used.
| bool PrintPreview::isZoomMode | ( | ) | const |
Returns whether zoom mode is active.
Returns the current page resolution in pixels.
Emitted when the page resolution changes.
| [in] | pixel_size | The new page resolution in pixels. |
| QPageSetupDialog * PrintPreview::pageSetupDialog | ( | ) |
Returns the page setup dialog.
| QPalette PrintPreview::printPalette | ( | ) | const |
Returns the palette used for print rendering.
|
static |
Creates or returns the singleton PrintPreview widget.
References PrintPreview().
|
static |
Creates or returns the singleton PrintPreview widget with the given images.
| [in] | images | The images to display in the preview. |
References PrintPreview().
| QPrintDialog * PrintPreview::printSetupDialog | ( | ) |
Returns the print setup dialog.
| void PrintPreview::printWidget | ( | QWidget * | widget, |
| const Buffer< QWidget * > & | custom_print_options = Buffer< QWidget * >() ) |
Prints a single widget.
| [in] | widget | The widget to print. |
| [in] | custom_print_options | Optional custom print settings widgets. |
Referenced by finishedSignal().
| void PrintPreview::printWidgets | ( | const Buffer< QWidget * > & | widgets, |
| const Buffer< QWidget * > & | custom_print_options = Buffer< QWidget * >() ) |
Prints multiple widgets.
| [in] | widgets | The widgets to print. |
| [in] | custom_print_options | Optional custom print settings widgets. |
Referenced by finishedSignal().
| void PrintPreview::printWidgets | ( | const DynamicPointer< WidgetIterator > & | reports, |
| const Buffer< QWidget * > & | custom_print_options = Buffer< QWidget * >() ) |
Prints widgets provided by a WidgetIterator.
| [in] | reports | The widget iterator providing pages to print. |
| [in] | custom_print_options | Optional custom print settings widgets. |
Returns the page resolution after applying the current scale.
| void PrintPreview::setCustomPrintSettingsWidgets | ( | const Buffer< QWidget * > & | widgets | ) |
Sets custom widgets to display in the print settings area.
| [in] | widgets | The custom settings widgets. |
| void PrintPreview::setImage | ( | uint04 | index, |
| const QImage & | image, | ||
| const Buffer< QWidget * > & | custom_print_options = Buffer< QWidget * >() ) |
Sets a specific image at the given index.
| [in] | index | The image index to replace. |
| [in] | image | The new image. |
| [in] | custom_print_options | Optional custom print settings widgets. |
| void PrintPreview::setImages | ( | const Buffer< QImage > & | images, |
| const Buffer< QWidget * > & | custom_print_options = Buffer< QWidget * >() ) |
Sets the images to print.
| [in] | images | The images to print. |
| [in] | custom_print_options | Optional custom print settings widgets. |
| void PrintPreview::setPreferredSize | ( | QSize | preferred_size | ) |
Sets the preferred page size for printing.
| [in] | preferred_size | The preferred size. |
| void PrintPreview::setPrintFont | ( | const QFont & | font | ) |
Sets the font used for print rendering.
| [in] | font | The font to use. |
|
overridevirtual |
Returns the preferred size hint for this widget.
|
static |
Checks whether the system has any configured printers.
| bool PrintPreview::zoomInToFit | ( | ) | const |
Returns whether zoom-to-fit is enabled.