KD Reports  1.9
KDReportsPreviewWidget.h
1 /****************************************************************************
2 **
3 ** This file is part of the KD Reports library.
4 **
5 ** SPDX-FileCopyrightText: 2007-2020 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 <QWidget>
22 #include <QPrinter>
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 = 0 );
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:
108  void pageSizeChanged( QPrinter::PageSize pageSize );
110  void orientationChanged( QPrinter::Orientation orientation );
112  void tableSettingsClicked();
113 
114 protected:
116  void resizeEvent(QResizeEvent *) override;
118  bool eventFilter(QObject*, QEvent*) override;
119 
120 private:
121  Q_PRIVATE_SLOT( d, void _kd_slotCurrentPageChanged() )
122  Q_PRIVATE_SLOT( d, void _kd_slotFirstPage() )
123  Q_PRIVATE_SLOT( d, void _kd_slotPrevPage() )
124  Q_PRIVATE_SLOT( d, void _kd_slotNextPage() )
125  Q_PRIVATE_SLOT( d, void _kd_slotLastPage() )
126  Q_PRIVATE_SLOT( d, void _kd_slotPaperSizeActivated( int ) )
127  Q_PRIVATE_SLOT( d, void _kd_slotPaperOrientationActivated( int ) )
128  Q_PRIVATE_SLOT( d, void _kd_slotZoomIn() )
129  Q_PRIVATE_SLOT( d, void _kd_slotZoomOut() )
130  Q_PRIVATE_SLOT( d, void _kd_slotZoomChanged() )
131  Q_PRIVATE_SLOT( d, void _kd_previewNextItems() )
132 
133  friend class PreviewWidgetPrivate;
134  PreviewWidgetPrivate* const d;
135 };
136 
137 }
138 
139 #endif
Definition: KDReportsReport.h:99
Definition: KDReportsAbstractTableElement.h:30
Definition: KDReportsPreviewWidget.h:34

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/