KD Reports API Documentation  2.1
KDReportsPreviewDialog.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 KDREPORTSPREVIEWDIALOG_H
18 #define KDREPORTSPREVIEWDIALOG_H
19 
20 #include "KDReportsGlobal.h"
21 #include <QDialog>
22 #include <QPrinter>
23 #include <memory>
24 
25 namespace KDReports {
26 class Report;
27 class PreviewWidget;
28 class PreviewDialogPrivate;
29 
35 {
36  Q_OBJECT
37 
38 public:
42  explicit PreviewDialog(KDReports::Report *report, QWidget *parent = nullptr);
43 
44  ~PreviewDialog() override;
45 
53  void setQuickPrinterName(const QString &printerName);
54 
61  void setDefaultSaveDirectory(const QString &path);
62 
71  void setDirectoryBrowsingEnabled(bool allowed);
72 
76  bool isSelected(int pageNumber) const;
77 
85  void setPageSizeChangeAllowed(bool b);
86 
92  void setShowTableSettingsDialog(bool b);
93 
98  void setWidthForEndlessPrinter(qreal widthMM);
99 
100  // maybe setZoomFactor() to set the initial value?
101 
109  virtual bool showTableSettingsDialog(KDReports::Report *report);
110 
116  KDReports::PreviewWidget *previewWidget();
117 
121  enum Result { Printed = 10,
123  SaveError };
124 
129  QString savedFileName() const;
130 
131 Q_SIGNALS:
132 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
133  void pageSizeChanged(QPrinter::PageSize pageSize);
136  void orientationChanged(QPrinter::Orientation orientation);
137 #else
138  void pageSizeChanged(const QPageSize &pageSize);
142 #endif
143 
147  void linkActivated(const QUrl &url);
148 
149 public Q_SLOTS:
151  void accept() override;
153  void reject() override;
154 
155 private:
156  std::unique_ptr<PreviewDialogPrivate> d;
157 };
158 
159 }
160 
161 #endif
KDReports::PreviewDialog
Definition: KDReportsPreviewDialog.h:35
QUrl
QWidget
KDReports::PreviewWidget
Definition: KDReportsPreviewWidget.h:36
QPagedPaintDevice::PageSize
PageSize
KDReports::PreviewDialog::SavedSuccessfully
@ SavedSuccessfully
Definition: KDReportsPreviewDialog.h:122
KDReports::PreviewDialog::linkActivated
void linkActivated(const QUrl &url)
KDReports::Report
Definition: KDReportsReport.h:81
QString
QPageLayout::Orientation
Orientation
KDReports::PreviewDialog::Result
Result
Definition: KDReportsPreviewDialog.h:121
KDReports::PreviewDialog::orientationChanged
void orientationChanged(QPageLayout::Orientation orientation)
Emitted when the user changes the page orientation.
KDReportsGlobal.h
QDialog
KDREPORTS_EXPORT
#define KDREPORTS_EXPORT
Definition: KDReportsGlobal.h:29
QPrinter::Orientation
Orientation
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:06 for KD Reports API Documentation by doxygen 1.8.20