QElectroTech  0.70
qetprintpreviewdialog.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef QET_PRINT_PREVIEW_DIALOG
19 #define QET_PRINT_PREVIEW_DIALOG
20 #include <QtWidgets>
21 #include "exportproperties.h"
22 
23 class Diagram;
24 class DiagramsChooser;
26 class QETProject;
27 class QPrintPreviewWidget;
28 class QPrinter;
29 
34 class QETPrintPreviewDialog : public QDialog {
35  Q_OBJECT
36 
37  // constructors, destructor
38  public:
39  QETPrintPreviewDialog(QETProject *, QPrinter *, QWidget * = nullptr, Qt::WindowFlags = nullptr);
40  ~QETPrintPreviewDialog() override;
41  private:
43 
44  // methods
45  public:
47  bool fitDiagramsToPages() const;
49 
50  // signaux
51  signals:
52  void paintRequested(const QList<Diagram *> &, bool, const ExportProperties, QPrinter *);
53 
54  public slots:
55  void firstPage();
56  void previousPage();
57  void nextPage();
58  void lastPage();
59  void pageSetup();
60  void useFullPage(bool);
61  void fitDiagramToPage(bool);
62  void zoomIn();
63  void zoomOut();
64  void selectAllDiagrams();
65  void selectNoDiagram();
66 
67  // attributes
68  private:
70  QPrinter *printer_;
71  QHBoxLayout *hlayout0_;
72  QVBoxLayout *vlayout0_;
73  QVBoxLayout *vlayout1_;
74  QVBoxLayout *vlayout2_;
75  QToolBar *toolbar_;
76  QPrintPreviewWidget *preview_;
77  QLabel *diagrams_label_;
79  QPushButton *diagrams_select_all_;
80  QPushButton *diagrams_select_none_;
83  QAction *adjust_width_;
84  QAction *adjust_page_;
85  QAction *zoom_in_;
86  QComboBox *zoom_box_;
87  QAction *zoom_out_;
88  QAction *landscape_;
89  QAction *portrait_;
90  QAction *first_page_;
91  QAction *previous_page_;
92  QAction *next_page_;
93  QAction *last_page_;
94  QAction *all_pages_view_;
97  QAction *page_setup_;
98  QDialogButtonBox *buttons_;
99  QGroupBox *print_options_box_;
100  QCheckBox *use_full_page_;
105 
106  // methods
107  private:
108  void build();
109 
110  private slots:
111  void requestPaint(QPrinter *);
112  void checkDiagramsCount();
113  void setDiagramsListVisible(bool);
114  void setPrintOptionsVisible(bool);
115  void updateZoomList();
116  void updatePreviewZoom();
117 };
118 #endif
ExportProperties exportProperties() const
DiagramsChooser * diagrams_list_
DiagramsChooser * diagramsChooser()
QPushButton * diagrams_select_all_
QETPrintPreviewDialog(QETProject *, QPrinter *, QWidget *=nullptr, Qt::WindowFlags=nullptr)
ExportPropertiesWidget * render_properties_
QPrintPreviewWidget * preview_
QDialogButtonBox * buttons_
void paintRequested(const QList< Diagram *> &, bool, const ExportProperties, QPrinter *)
QPushButton * diagrams_select_none_