Warning, file /include/QtPrintSupport/qprintpreviewwidget.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004 #ifndef QPRINTPREVIEWWIDGET_H
0005 #define QPRINTPREVIEWWIDGET_H
0006
0007 #include <QtPrintSupport/qtprintsupportglobal.h>
0008 #include <QtWidgets/qwidget.h>
0009 #include <QtPrintSupport/qprinter.h>
0010
0011 QT_REQUIRE_CONFIG(printpreviewwidget);
0012
0013 QT_BEGIN_NAMESPACE
0014
0015
0016 class QPrintPreviewWidgetPrivate;
0017
0018 class Q_PRINTSUPPORT_EXPORT QPrintPreviewWidget : public QWidget
0019 {
0020 Q_OBJECT
0021 Q_DECLARE_PRIVATE(QPrintPreviewWidget)
0022 public:
0023
0024 enum ViewMode {
0025 SinglePageView,
0026 FacingPagesView,
0027 AllPagesView
0028 };
0029
0030 enum ZoomMode {
0031 CustomZoom,
0032 FitToWidth,
0033 FitInView
0034 };
0035
0036 explicit QPrintPreviewWidget(QPrinter *printer, QWidget *parent = nullptr,
0037 Qt::WindowFlags flags = Qt::WindowFlags());
0038 explicit QPrintPreviewWidget(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
0039 ~QPrintPreviewWidget();
0040
0041 qreal zoomFactor() const;
0042 QPageLayout::Orientation orientation() const;
0043 ViewMode viewMode() const;
0044 ZoomMode zoomMode() const;
0045 int currentPage() const;
0046 int pageCount() const;
0047 void setVisible(bool visible) override;
0048
0049 public Q_SLOTS:
0050 void print();
0051
0052 void zoomIn(qreal zoom = 1.1);
0053 void zoomOut(qreal zoom = 1.1);
0054 void setZoomFactor(qreal zoomFactor);
0055 void setOrientation(QPageLayout::Orientation orientation);
0056 void setViewMode(ViewMode viewMode);
0057 void setZoomMode(ZoomMode zoomMode);
0058 void setCurrentPage(int pageNumber);
0059
0060 void fitToWidth();
0061 void fitInView();
0062 void setLandscapeOrientation();
0063 void setPortraitOrientation();
0064 void setSinglePageViewMode();
0065 void setFacingPagesViewMode();
0066 void setAllPagesViewMode();
0067
0068 void updatePreview();
0069
0070 Q_SIGNALS:
0071 void paintRequested(QPrinter *printer);
0072 void previewChanged();
0073
0074 private:
0075 Q_PRIVATE_SLOT(d_func(), void _q_fit())
0076 Q_PRIVATE_SLOT(d_func(), void _q_updateCurrentPage())
0077 };
0078
0079 QT_END_NAMESPACE
0080
0081 #endif