KD Reports  1.8
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

Public Slots

void accept ()
 Reimplemented for internal purposes.
 
void reject ()
 Reimplemented for internal purposes.
 

Signals

void pageSizeChanged (QPrinter::PageSize pageSize)
 Emitted when the user changes the page size.
 
void orientationChanged (QPrinter::Orientation orientation)
 Emitted when the user changes the page orientation.
 

Public Member Functions

 PreviewDialog (KDReports::Report *report, QWidget *parent=0)
 
void setQuickPrinterName (const QString &printerName)
 
void setDefaultSaveDirectory (const QString &path)
 
void setDirectoryBrowsingEnabled (bool allowed)
 
bool isSelected (int pageNumber) const
 
void setPageSizeChangeAllowed (bool b)
 
void setShowTableSettingsDialog (bool b)
 
void setWidthForEndlessPrinter (qreal widthMM)
 
virtual bool showTableSettingsDialog (KDReports::Report *report)
 
KDReports::PreviewWidgetpreviewWidget ()
 
QString savedFileName () const
 

Detailed Description

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

Member Enumeration Documentation

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

Constructor & Destructor Documentation

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

Constructs a preview dialog.

Member Function Documentation

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

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

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
QString KDReports::PreviewDialog::savedFileName ( ) const

The location where the report was saved, if the user saved it Only set after exec returns.

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

Sets the initial directory for the save dialog.

Parameters
paththe initial directory
Since
1.7
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
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.

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

virtual 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

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

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/