KD Reports API Documentation  2.1
KDReportsPreviewWidget.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** This file is part of the KD Reports library.
4 **
5 ** SPDX-FileCopyrightText: 2007-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDAB-KDReports OR LicenseRef-KDAB-KDReports-US
8 **
9 ** Licensees holding valid commercial KD Reports licenses may use this file in
10 ** accordance with the KD Reports Commercial License Agreement provided with
11 ** the Software.
12 **
13 ** Contact info@kdab.com if any conditions of this licensing are not clear to you.
14 **
15 ****************************************************************************/
16 
17 #ifndef KDREPORTSPREVIEWWIDGET_H
18 #define KDREPORTSPREVIEWWIDGET_H
19 
20 #include "KDReportsGlobal.h"
21 #include <QPrinter>
22 #include <QWidget>
23 #include <memory>
24 
25 namespace KDReports {
26 class Report;
27 class PreviewWidgetPrivate;
28 
36 {
37  Q_OBJECT
38 
39 public:
43  explicit PreviewWidget(QWidget *parent = nullptr);
44 
45  ~PreviewWidget() override;
46 
50  void setReport(KDReports::Report *report);
51 
55  bool isSelected(int pageNumber) const;
56 
64  void setPageSizeChangeAllowed(bool b);
65 
71  void setShowTableSettingsDialog(bool b);
72 
77  void setWidthForEndlessPrinter(qreal widthMM);
78 
79  // maybe setZoomFactor() to set the initial value?
80 
84  KDReports::Report *report() const;
85 
90  bool printWithDialog();
91 
95  void setShowPageListWidget(bool show);
96 
100  void repaint();
101 
105  QSize sizeHint() const override;
106 
107 Q_SIGNALS:
108 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
109  void pageSizeChanged(QPrinter::PageSize pageSize);
112  void orientationChanged(QPrinter::Orientation orientation);
113 #else
114  void pageSizeChanged(const QPageSize &pageSize);
118 #endif
119 
126  void linkActivated(const QUrl &url);
127 
128 protected:
130  void resizeEvent(QResizeEvent *) override;
132  bool eventFilter(QObject *, QEvent *) override;
133 
134 private:
135  friend class PreviewWidgetPrivate;
136  std::unique_ptr<PreviewWidgetPrivate> d;
137 };
138 
139 }
140 
141 #endif
QUrl
QWidget
QSize
KDReports::PreviewWidget
Definition: KDReportsPreviewWidget.h:36
QPagedPaintDevice::PageSize
PageSize
KDReports::PreviewWidget::tableSettingsClicked
void tableSettingsClicked()
Emitted when the table settings button has been clicked.
KDReports::Report
Definition: KDReportsReport.h:81
QObject
QPageLayout::Orientation
Orientation
KDReports::PreviewWidget::orientationChanged
void orientationChanged(QPageLayout::Orientation orientation)
Emitted when the user changes the page orientation.
QEvent
QResizeEvent
KDReportsGlobal.h
KDREPORTS_EXPORT
#define KDREPORTS_EXPORT
Definition: KDReportsGlobal.h:29
QPrinter::Orientation
Orientation
KDReports::PreviewWidget::linkActivated
void linkActivated(const QUrl &url)
QPageSize
KDReports
Definition: KDReportsAbstractReportLayout_p.h:30

© 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 Fri Jul 15 2022 13:09:07 for KD Reports API Documentation by doxygen 1.8.20