KD Reports API Documentation  2.2
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 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: MIT
8 **
9 ****************************************************************************/
10 
11 #ifndef KDREPORTSPREVIEWWIDGET_H
12 #define KDREPORTSPREVIEWWIDGET_H
13 
14 #include "KDReportsGlobal.h"
15 #include <QPrinter>
16 #include <QWidget>
17 #include <memory>
18 
19 namespace KDReports {
20 class Report;
21 class PreviewWidgetPrivate;
22 
29 class KDREPORTS_EXPORT PreviewWidget : public QWidget
30 {
31  Q_OBJECT
32 
33 public:
37  explicit PreviewWidget(QWidget *parent = nullptr);
38 
39  ~PreviewWidget() override;
40 
44  void setReport(KDReports::Report *report);
45 
49  bool isSelected(int pageNumber) const;
50 
58  void setPageSizeChangeAllowed(bool b);
59 
65  void setShowTableSettingsDialog(bool b);
66 
71  void setWidthForEndlessPrinter(qreal widthMM);
72 
73  // maybe setZoomFactor() to set the initial value?
74 
78  KDReports::Report *report() const;
79 
84  bool printWithDialog();
85 
89  void setShowPageListWidget(bool show);
90 
94  void repaint();
95 
99  QSize sizeHint() const override;
100 
101 Q_SIGNALS:
102 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
104  void pageSizeChanged(QPrinter::PageSize pageSize);
106  void orientationChanged(QPrinter::Orientation orientation);
107 #else
109  void pageSizeChanged(const QPageSize &pageSize);
111  void orientationChanged(QPageLayout::Orientation orientation);
112 #endif
113 
120  void linkActivated(const QUrl &url);
121 
122 protected:
124  void resizeEvent(QResizeEvent *) override;
126  bool eventFilter(QObject *, QEvent *) override;
127 
128 private:
129  friend class PreviewWidgetPrivate;
130  std::unique_ptr<PreviewWidgetPrivate> d;
131 };
132 
133 }
134 
135 #endif
#define KDREPORTS_EXPORT
void tableSettingsClicked()
Emitted when the table settings button has been clicked.
void orientationChanged(QPageLayout::Orientation orientation)
Emitted when the user changes the page orientation.
void linkActivated(const QUrl &url)
void pageSizeChanged(const QPageSize &pageSize)
Emitted when the user changes the page size.

© 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