KD Reports API Documentation  2.2
Signals | Public Member Functions | Protected Member Functions | List of all members
KDReports::PreviewWidget Class Reference

#include <KDReportsPreviewWidget.h>

Inheritance diagram for KDReports::PreviewWidget:

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...
 
void tableSettingsClicked ()
 Emitted when the table settings button has been clicked. More...
 

Public Member Functions

 PreviewWidget (QWidget *parent=nullptr)
 
 ~PreviewWidget () override
 
bool isSelected (int pageNumber) const
 
bool printWithDialog ()
 
void repaint ()
 
KDReports::Reportreport () const
 
void setPageSizeChangeAllowed (bool b)
 
void setReport (KDReports::Report *report)
 
void setShowPageListWidget (bool show)
 
void setShowTableSettingsDialog (bool b)
 
void setWidthForEndlessPrinter (qreal widthMM)
 
QSize sizeHint () const override
 

Protected Member Functions

bool eventFilter (QObject *, QEvent *) override
 Reimplemented for internal purposes.
. More...
 
void resizeEvent (QResizeEvent *) override
 Reimplemented for internal purposes.
. More...
 

Detailed Description

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

Since
1.2

Definition at line 29 of file KDReportsPreviewWidget.h.

Constructor & Destructor Documentation

◆ PreviewWidget()

KDReports::PreviewWidget::PreviewWidget ( QWidget *  parent = nullptr)
explicit

Constructs a preview widget.

Definition at line 594 of file KDReportsPreviewWidget.cpp.

◆ ~PreviewWidget()

KDReports::PreviewWidget::~PreviewWidget ( )
override

Definition at line 601 of file KDReportsPreviewWidget.cpp.

Member Function Documentation

◆ eventFilter()

bool KDReports::PreviewWidget::eventFilter ( QObject *  obj,
QEvent *  ev 
)
overrideprotected

Reimplemented for internal purposes.
.

Definition at line 631 of file KDReportsPreviewWidget.cpp.

◆ isSelected()

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

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

Definition at line 605 of file KDReportsPreviewWidget.cpp.

◆ linkActivated

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

Emitted when the user clicked on a hyperlink

Since
2.0

Referenced by KDReports::PreviewDialog::PreviewDialog().

◆ orientationChanged

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

Emitted when the user changes the page orientation.

◆ pageSizeChanged

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

Emitted when the user changes the page size.

◆ printWithDialog()

bool KDReports::PreviewWidget::printWithDialog ( )

Show the print dialog and print the selected pages

Returns
false if the dialog was cancelled

Definition at line 666 of file KDReportsPreviewWidget.cpp.

References KDReports::AllPages.

◆ repaint()

void KDReports::PreviewWidget::repaint ( )

Updates the preview. Call this after the report has changed.

Definition at line 733 of file KDReportsPreviewWidget.cpp.

◆ report()

KDReports::Report * KDReports::PreviewWidget::report ( ) const
Returns
the report passed to the constructor or to setReport.

Definition at line 661 of file KDReportsPreviewWidget.cpp.

◆ resizeEvent()

void KDReports::PreviewWidget::resizeEvent ( QResizeEvent *  )
overrideprotected

Reimplemented for internal purposes.
.

Definition at line 613 of file KDReportsPreviewWidget.cpp.

◆ setPageSizeChangeAllowed()

void KDReports::PreviewWidget::setPageSizeChangeAllowed ( bool  b)

Set to false if you want to prevent the user from changing the page size in the preview widget. 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 618 of file KDReportsPreviewWidget.cpp.

◆ setReport()

void KDReports::PreviewWidget::setReport ( KDReports::Report report)

Show a different report in the preview widget

Definition at line 697 of file KDReportsPreviewWidget.cpp.

◆ setShowPageListWidget()

void KDReports::PreviewWidget::setShowPageListWidget ( bool  show)

Show/hide the page list widget (with small previews) on the left.

Definition at line 728 of file KDReportsPreviewWidget.cpp.

◆ setShowTableSettingsDialog()

void KDReports::PreviewWidget::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 626 of file KDReportsPreviewWidget.cpp.

◆ setWidthForEndlessPrinter()

void KDReports::PreviewWidget::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 656 of file KDReportsPreviewWidget.cpp.

◆ sizeHint()

QSize KDReports::PreviewWidget::sizeHint ( ) const
override

Reimplemented for internal purposes.

Definition at line 739 of file KDReportsPreviewWidget.cpp.

◆ tableSettingsClicked

void KDReports::PreviewWidget::tableSettingsClicked ( )
signal

Emitted when the table settings button has been clicked.

Referenced by KDReports::PreviewDialog::PreviewDialog().


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

© 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 by doxygen 1.9.1