KD Reports  1.8
KDReportsPreviewWidget.h
1 /****************************************************************************
2 ** Copyright (C) 2007-2020 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Reports library.
5 **
6 ** Licensees holding valid commercial KD Reports licenses may use this file in
7 ** accordance with the KD Reports Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU Lesser General Public License version 2.1 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #ifndef KDREPORTSPREVIEWWIDGET_H
24 #define KDREPORTSPREVIEWWIDGET_H
25 
26 #include "KDReportsGlobal.h"
27 #include <QWidget>
28 #include <QPrinter>
29 
30 namespace KDReports {
31 class Report;
32 class PreviewWidgetPrivate;
33 
40 class KDREPORTS_EXPORT PreviewWidget : public QWidget
41 {
42  Q_OBJECT
43 
44 public:
48  explicit PreviewWidget( QWidget *parent = 0 );
49 
50  ~PreviewWidget();
51 
55  void setReport( KDReports::Report* report );
56 
60  bool isSelected( int pageNumber ) const;
61 
69  void setPageSizeChangeAllowed( bool b );
70 
76  void setShowTableSettingsDialog( bool b );
77 
82  void setWidthForEndlessPrinter( qreal widthMM );
83 
84  // maybe setZoomFactor() to set the initial value?
85 
89  KDReports::Report* report() const;
90 
95  bool printWithDialog();
96 
100  void setShowPageListWidget( bool show );
101 
105  void repaint();
106 
110  QSize sizeHint() const;
111 
112 Q_SIGNALS:
114  void pageSizeChanged( QPrinter::PageSize pageSize );
116  void orientationChanged( QPrinter::Orientation orientation );
118  void tableSettingsClicked();
119 
120 protected:
122  void resizeEvent(QResizeEvent *);
124  bool eventFilter(QObject*, QEvent*);
125 
126 private:
127  Q_PRIVATE_SLOT( d, void _kd_slotCurrentPageChanged() )
128  Q_PRIVATE_SLOT( d, void _kd_slotFirstPage() )
129  Q_PRIVATE_SLOT( d, void _kd_slotPrevPage() )
130  Q_PRIVATE_SLOT( d, void _kd_slotNextPage() )
131  Q_PRIVATE_SLOT( d, void _kd_slotLastPage() )
132  Q_PRIVATE_SLOT( d, void _kd_slotPaperSizeActivated( int ) )
133  Q_PRIVATE_SLOT( d, void _kd_slotPaperOrientationActivated( int ) )
134  Q_PRIVATE_SLOT( d, void _kd_slotZoomIn() )
135  Q_PRIVATE_SLOT( d, void _kd_slotZoomOut() )
136  Q_PRIVATE_SLOT( d, void _kd_slotZoomChanged() )
137  Q_PRIVATE_SLOT( d, void _kd_previewNextItems() )
138 
139  friend class PreviewWidgetPrivate;
140  PreviewWidgetPrivate* const d;
141 };
142 
143 }
144 
145 #endif
Definition: KDReportsReport.h:109
Definition: KDReportsAbstractTableElement.h:36
Definition: KDReportsPreviewWidget.h:40

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/