KD Reports API Documentation  2.0
Public Types | Public Slots | Signals | Public Member Functions | List of all members
KDReports::PreviewDialog Class Reference

#include <KDReportsPreviewDialog.h>

Inheritance diagram for KDReports::PreviewDialog:
Inheritance graph
[legend]
Collaboration diagram for KDReports::PreviewDialog:
Collaboration graph
[legend]

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::PreviewWidgetpreviewWidget ()
 
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)
 

Detailed Description

The PreviewDialog class provides a dialog showing the report to the user, typically used for "print preview" functionality.

Definition at line 47 of file KDReportsPreviewDialog.h.

Member Enumeration Documentation

◆ Result

The Result enum describes result code accessible with QDialog::result()

Enumerator
Printed 
SavedSuccessfully 
SaveError 

Definition at line 134 of file KDReportsPreviewDialog.h.

Constructor & Destructor Documentation

◆ PreviewDialog()

KDReports::PreviewDialog::PreviewDialog ( KDReports::Report report,
QWidget *  parent = nullptr 
)
explicit

◆ ~PreviewDialog()

KDReports::PreviewDialog::~PreviewDialog ( )
override

Definition at line 93 of file KDReportsPreviewDialog.cpp.

Member Function Documentation

◆ accept

void KDReports::PreviewDialog::accept ( )
overrideslot

Reimplemented for internal purposes.
.

Definition at line 218 of file KDReportsPreviewDialog.cpp.

◆ isSelected()

bool KDReports::PreviewDialog::isSelected ( int  pageNumber) const

Return true if the page has been selected (checked) by the user.

Definition at line 213 of file KDReportsPreviewDialog.cpp.

◆ linkActivated

void KDReports::PreviewDialog::linkActivated ( const QUrl &  url)
signal

Emitted when the user clicked on a hyperlink

Since
2.0

Referenced by PreviewDialog().

◆ orientationChanged

void KDReports::PreviewDialog::orientationChanged ( QPageLayout::Orientation  orientation)
signal

Emitted when the user changes the page orientation.

◆ pageSizeChanged

void KDReports::PreviewDialog::pageSizeChanged ( const QPageSize &  pageSize)
signal

Emitted when the user changes the page size.

◆ previewWidget()

KDReports::PreviewWidget * KDReports::PreviewDialog::previewWidget ( )

Returns the preview widget used in this dialog. Can be used for fine tuning, for instance setShowPageListWidget(false).

Since
1.4

Definition at line 228 of file KDReportsPreviewDialog.cpp.

◆ reject

void KDReports::PreviewDialog::reject ( )
overrideslot

Reimplemented for internal purposes.
.

Definition at line 223 of file KDReportsPreviewDialog.cpp.

◆ savedFileName()

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 233 of file KDReportsPreviewDialog.cpp.

◆ setDefaultSaveDirectory()

void KDReports::PreviewDialog::setDefaultSaveDirectory ( const QString &  path)

Sets the initial directory for the save dialog.

Parameters
paththe initial directory
Since
1.7

Definition at line 111 of file KDReportsPreviewDialog.cpp.

◆ setDirectoryBrowsingEnabled()

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().

Since
1.7

Definition at line 116 of file KDReportsPreviewDialog.cpp.

◆ setPageSizeChangeAllowed()

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 198 of file KDReportsPreviewDialog.cpp.

◆ setQuickPrinterName()

void KDReports::PreviewDialog::setQuickPrinterName ( const QString &  printerName)

Shows a [Print on <printer>] button, for quick printing without the print dialog

Parameters
printerNamethe name of the printer for the quick print button to use. Setting an empty printer name has no effect.
Since
1.7

Definition at line 98 of file KDReportsPreviewDialog.cpp.

◆ setShowTableSettingsDialog()

void KDReports::PreviewDialog::setShowTableSettingsDialog ( bool  b)

Show or hide the button for configuring table settings and font scaling. The button is shown by default.

Since
1.1

Definition at line 203 of file KDReportsPreviewDialog.cpp.

◆ setWidthForEndlessPrinter()

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 208 of file KDReportsPreviewDialog.cpp.

◆ showTableSettingsDialog()

bool KDReports::PreviewDialog::showTableSettingsDialog ( KDReports::Report report)
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.

Since
1.1

Definition at line 121 of file KDReportsPreviewDialog.cpp.


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

© 2007-2021 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-reports/
Generated on Sat Jan 8 2022 02:38:32 for KD Reports API Documentation by doxygen 1.8.17