KD Reports API Documentation  2.2
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 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: MIT
8 **
9 ****************************************************************************/
10 
11 #ifndef KDREPORTSPREVIEWDIALOG_H
12 #define KDREPORTSPREVIEWDIALOG_H
13 
14 #include "KDReportsGlobal.h"
15 #include <QDialog>
16 #include <QPrinter>
17 #include <memory>
18 
19 namespace KDReports {
20 class Report;
21 class PreviewWidget;
22 class PreviewDialogPrivate;
23 
28 class KDREPORTS_EXPORT PreviewDialog : public QDialog
29 {
30  Q_OBJECT
31 
32 public:
36  explicit PreviewDialog(KDReports::Report *report, QWidget *parent = nullptr);
37 
38  ~PreviewDialog() override;
39 
47  void setQuickPrinterName(const QString &printerName);
48 
55  void setDefaultSaveDirectory(const QString &path);
56 
65  void setDirectoryBrowsingEnabled(bool allowed);
66 
70  bool isSelected(int pageNumber) const;
71 
79  void setPageSizeChangeAllowed(bool b);
80 
86  void setShowTableSettingsDialog(bool b);
87 
92  void setWidthForEndlessPrinter(qreal widthMM);
93 
94  // maybe setZoomFactor() to set the initial value?
95 
103  virtual bool showTableSettingsDialog(KDReports::Report *report);
104 
110  KDReports::PreviewWidget *previewWidget();
111 
115  enum Result
116  {
117  Printed = 10,
119  SaveError
120  };
121 
126  QString savedFileName() const;
127 
128 Q_SIGNALS:
129 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
131  void pageSizeChanged(QPrinter::PageSize pageSize);
133  void orientationChanged(QPrinter::Orientation orientation);
134 #else
136  void pageSizeChanged(const QPageSize &pageSize);
138  void orientationChanged(QPageLayout::Orientation orientation);
139 #endif
144  void linkActivated(const QUrl &url);
145 
146 public Q_SLOTS:
148  void accept() override;
150  void reject() override;
151 
152 private:
153  std::unique_ptr<PreviewDialogPrivate> d;
154 };
155 
156 }
157 
158 #endif
#define KDREPORTS_EXPORT
void orientationChanged(QPageLayout::Orientation orientation)
Emitted when the user changes the page orientation.
void pageSizeChanged(const QPageSize &pageSize)
Emitted when the user changes the page size.
void linkActivated(const QUrl &url)

© 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