KD Reports API Documentation  2.0
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 
24 namespace KDReports {
25 class Report;
26 class PreviewWidgetPrivate;
27 
34 class KDREPORTS_EXPORT PreviewWidget : public QWidget
35 {
36  Q_OBJECT
37 
38 public:
42  explicit PreviewWidget(QWidget *parent = nullptr);
43 
44  ~PreviewWidget() override;
45 
49  void setReport(KDReports::Report *report);
50 
54  bool isSelected(int pageNumber) const;
55 
63  void setPageSizeChangeAllowed(bool b);
64 
70  void setShowTableSettingsDialog(bool b);
71 
76  void setWidthForEndlessPrinter(qreal widthMM);
77 
78  // maybe setZoomFactor() to set the initial value?
79 
83  KDReports::Report *report() const;
84 
89  bool printWithDialog();
90 
94  void setShowPageListWidget(bool show);
95 
99  void repaint();
100 
104  QSize sizeHint() const override;
105 
106 Q_SIGNALS:
107 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
108  void pageSizeChanged(QPrinter::PageSize pageSize);
111  void orientationChanged(QPrinter::Orientation orientation);
112 #else
113  void pageSizeChanged(const QPageSize &pageSize);
116  void orientationChanged(QPageLayout::Orientation orientation);
117 #endif
118 
120  void tableSettingsClicked();
125  void linkActivated(const QUrl &url);
126 
127 protected:
129  void resizeEvent(QResizeEvent *) override;
131  bool eventFilter(QObject *, QEvent *) override;
132 
133 private:
134  friend class PreviewWidgetPrivate;
135  PreviewWidgetPrivate *const d;
136 };
137 
138 }
139 
140 #endif
KDReports::Report
Definition: KDReportsReport.h:80
KDReportsGlobal.h
KDREPORTS_EXPORT
#define KDREPORTS_EXPORT
Definition: KDReportsGlobal.h:29
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 Sat Jan 8 2022 02:38:32 for KD Reports API Documentation by doxygen 1.8.17