KD Reports API Documentation
2.2
|
#include <KDReportsPreviewDialog.h>
Public Types | |
enum | Result { Printed = 10 , SavedSuccessfully , SaveError } |
Public Slots | |
void | accept () override |
Reimplemented for internal purposes. . More... | |
void | reject () override |
Reimplemented for internal purposes. . More... | |
Signals | |
void | linkActivated (const QUrl &url) |
void | orientationChanged (QPageLayout::Orientation orientation) |
Emitted when the user changes the page orientation. More... | |
void | pageSizeChanged (const QPageSize &pageSize) |
Emitted when the user changes the page size. More... | |
Public Member Functions | |
PreviewDialog (KDReports::Report *report, QWidget *parent=nullptr) | |
~PreviewDialog () override | |
bool | isSelected (int pageNumber) const |
KDReports::PreviewWidget * | previewWidget () |
QString | savedFileName () const |
void | setDefaultSaveDirectory (const QString &path) |
void | setDirectoryBrowsingEnabled (bool allowed) |
void | setPageSizeChangeAllowed (bool b) |
void | setQuickPrinterName (const QString &printerName) |
void | setShowTableSettingsDialog (bool b) |
void | setWidthForEndlessPrinter (qreal widthMM) |
virtual bool | showTableSettingsDialog (KDReports::Report *report) |
The PreviewDialog class provides a dialog showing the report to the user, typically used for "print preview" functionality.
Definition at line 28 of file KDReportsPreviewDialog.h.
The Result enum describes result code accessible with QDialog::result()
Enumerator | |
---|---|
Printed | |
SavedSuccessfully | |
SaveError |
Definition at line 115 of file KDReportsPreviewDialog.h.
|
explicit |
Constructs a preview dialog.
Definition at line 52 of file KDReportsPreviewDialog.cpp.
References linkActivated(), KDReports::PreviewWidget::linkActivated(), and KDReports::PreviewWidget::tableSettingsClicked().
|
override |
Definition at line 87 of file KDReportsPreviewDialog.cpp.
|
overrideslot |
Reimplemented for internal purposes.
.
Definition at line 209 of file KDReportsPreviewDialog.cpp.
bool KDReports::PreviewDialog::isSelected | ( | int | pageNumber | ) | const |
Return true if the page has been selected (checked) by the user.
Definition at line 204 of file KDReportsPreviewDialog.cpp.
|
signal |
|
signal |
Emitted when the user changes the page orientation.
|
signal |
Emitted when the user changes the page size.
KDReports::PreviewWidget * KDReports::PreviewDialog::previewWidget | ( | ) |
Returns the preview widget used in this dialog. Can be used for fine tuning, for instance setShowPageListWidget(false).
Definition at line 219 of file KDReportsPreviewDialog.cpp.
|
overrideslot |
Reimplemented for internal purposes.
.
Definition at line 214 of file KDReportsPreviewDialog.cpp.
QString KDReports::PreviewDialog::savedFileName | ( | ) | const |
The location where the report was saved, if the user saved it Only set after exec returns.
Definition at line 224 of file KDReportsPreviewDialog.cpp.
void KDReports::PreviewDialog::setDefaultSaveDirectory | ( | const QString & | path | ) |
Sets the initial directory for the save dialog.
path | the initial directory |
Definition at line 104 of file KDReportsPreviewDialog.cpp.
void KDReports::PreviewDialog::setDirectoryBrowsingEnabled | ( | bool | allowed | ) |
Allows or forbids the user from choosing the save directory. If allowed (the default) the Save button shows a file dialog. If forbidden, the Save button shows a text input field for choosing only the filename, and the directory will be the one set by setDefaultSaveDirectory().
Definition at line 109 of file KDReportsPreviewDialog.cpp.
void KDReports::PreviewDialog::setPageSizeChangeAllowed | ( | bool | b | ) |
Set to false if you want to prevent the user from changing the page size in the preview dialog. Set to true if you want to allow the user to change the page size; note that this leads to a call to Report::setPageSize(). Changing the page size is allowed by default.
Definition at line 189 of file KDReportsPreviewDialog.cpp.
void KDReports::PreviewDialog::setQuickPrinterName | ( | const QString & | printerName | ) |
Shows a [Print on <printer>] button, for quick printing without the print dialog
printerName | the name of the printer for the quick print button to use. Setting an empty printer name has no effect. |
Definition at line 91 of file KDReportsPreviewDialog.cpp.
void KDReports::PreviewDialog::setShowTableSettingsDialog | ( | bool | b | ) |
Show or hide the button for configuring table settings and font scaling. The button is shown by default.
Definition at line 194 of file KDReportsPreviewDialog.cpp.
void KDReports::PreviewDialog::setWidthForEndlessPrinter | ( | qreal | widthMM | ) |
Sets the width of the endless printer, in case the user selects that item from the page selection combobox.
Definition at line 199 of file KDReportsPreviewDialog.cpp.
|
virtual |
Shows the table settings (and font scaling) dialog. Called when the user clicks on the corresponding button. This is a virtual method so that the dialog can be replaced or subclassed.
Definition at line 114 of file KDReportsPreviewDialog.cpp.