QElectroTech  0.8-dev
qetprintpreviewdialog.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 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 = Qt::Widget);
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
QETPrintPreviewDialog::use_full_page_
QCheckBox * use_full_page_
Definition: qetprintpreviewdialog.h:100
QETPrintPreviewDialog::diagrams_list_
DiagramsChooser * diagrams_list_
Definition: qetprintpreviewdialog.h:78
QETPrintPreviewDialog::first_page_
QAction * first_page_
Definition: qetprintpreviewdialog.h:90
QET::Icons::Configure
QIcon Configure
Definition: qeticons.cpp:38
QETPrintPreviewDialog::checkDiagramsCount
void checkDiagramsCount()
Definition: qetprintpreviewdialog.cpp:348
QET::Icons::ArrowLeft
QIcon ArrowLeft
Definition: qeticons.cpp:28
QETPrintPreviewDialog::fit_diagram_to_page_
QCheckBox * fit_diagram_to_page_
Definition: qetprintpreviewdialog.h:102
ExportPropertiesWidget
Definition: exportpropertieswidget.h:27
exportpropertieswidget.h
QETPrintPreviewDialog::portrait_
QAction * portrait_
Definition: qetprintpreviewdialog.h:89
QETPrintPreviewDialog::pageSetup
void pageSetup()
Definition: qetprintpreviewdialog.cpp:110
QETPrintPreviewDialog::previous_page_
QAction * previous_page_
Definition: qetprintpreviewdialog.h:91
QETPrintPreviewDialog::exportProperties
ExportProperties exportProperties() const
Definition: qetprintpreviewdialog.cpp:73
QETPrintPreviewDialog::fitDiagramsToPages
bool fitDiagramsToPages() const
Definition: qetprintpreviewdialog.cpp:66
QETPrintPreviewDialog::zoomIn
void zoomIn()
Definition: qetprintpreviewdialog.cpp:141
QET::Icons::ZoomIn
QIcon ZoomIn
Definition: qeticons.cpp:179
QET::Icons::ViewFitWidth
QIcon ViewFitWidth
Definition: qeticons.cpp:170
QETPrintPreviewDialog::zoom_in_
QAction * zoom_in_
Definition: qetprintpreviewdialog.h:85
QETPrintPreviewDialog::nextPage
void nextPage()
Definition: qetprintpreviewdialog.cpp:95
QET::Icons::ZoomOut
QIcon ZoomOut
Definition: qeticons.cpp:181
QETPrintPreviewDialog::QETPrintPreviewDialog
QETPrintPreviewDialog(const QETPrintPreviewDialog &)
QETPrintPreviewDialog::vlayout2_
QVBoxLayout * vlayout2_
Definition: qetprintpreviewdialog.h:74
QETPrintPreviewDialog::adjust_width_
QAction * adjust_width_
Definition: qetprintpreviewdialog.h:83
QETPrintPreviewDialog::vlayout0_
QVBoxLayout * vlayout0_
Definition: qetprintpreviewdialog.h:72
exportproperties.h
QET::Icons::ArrowRightDouble
QIcon ArrowRightDouble
Definition: qeticons.cpp:31
QETPrintPreviewDialog::paintRequested
void paintRequested(const QList< Diagram * > &, bool, const ExportProperties, QPrinter *)
QETPrintPreviewDialog::vlayout1_
QVBoxLayout * vlayout1_
Definition: qetprintpreviewdialog.h:73
QETPrintPreviewDialog::requestPaint
void requestPaint(QPrinter *)
Definition: qetprintpreviewdialog.cpp:333
QET::Icons::ArrowRight
QIcon ArrowRight
Definition: qeticons.cpp:30
QETPrintPreviewDialog::toggle_diagrams_list_
QAction * toggle_diagrams_list_
Definition: qetprintpreviewdialog.h:81
QETPrintPreviewDialog::next_page_
QAction * next_page_
Definition: qetprintpreviewdialog.h:92
QETPrintPreviewDialog::all_pages_view_
QAction * all_pages_view_
Definition: qetprintpreviewdialog.h:94
QET::Icons::DocumentPrint
QIcon DocumentPrint
Definition: qeticons.cpp:56
QETPrintPreviewDialog::updateZoomList
void updateZoomList()
Definition: qetprintpreviewdialog.cpp:392
QETPrintPreviewDialog::~QETPrintPreviewDialog
~QETPrintPreviewDialog() override
Definition: qetprintpreviewdialog.cpp:53
QETPrintPreviewDialog::build
void build()
Definition: qetprintpreviewdialog.cpp:171
QETPrintPreviewDialog::landscape_
QAction * landscape_
Definition: qetprintpreviewdialog.h:88
QET::Icons::PrintAllPages
QIcon PrintAllPages
Definition: qeticons.cpp:138
Diagram
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
qeticons.h
QETPrintPreviewDialog
Definition: qetprintpreviewdialog.h:34
QETPrintPreviewDialog::selectNoDiagram
void selectNoDiagram()
Definition: qetprintpreviewdialog.cpp:164
QETPrintPreviewDialog::preview_
QPrintPreviewWidget * preview_
Definition: qetprintpreviewdialog.h:76
QETPrintPreviewDialog::last_page_
QAction * last_page_
Definition: qetprintpreviewdialog.h:93
QETPrintPreviewDialog::toggle_print_options_
QAction * toggle_print_options_
Definition: qetprintpreviewdialog.h:82
QETPrintPreviewDialog::QETPrintPreviewDialog
QETPrintPreviewDialog(QETProject *, QPrinter *, QWidget *=nullptr, Qt::WindowFlags=Qt::Widget)
Definition: qetprintpreviewdialog.cpp:35
QET::Icons::ViewFitWindow
QIcon ViewFitWindow
Definition: qeticons.cpp:171
QET::Icons::PrintLandscape
QIcon PrintLandscape
Definition: qeticons.cpp:140
QETPrintPreviewDialog::printer_
QPrinter * printer_
Definition: qetprintpreviewdialog.h:70
QETPrintPreviewDialog::firstPage
void firstPage()
Definition: qetprintpreviewdialog.cpp:80
QETPrintPreviewDialog::toolbar_
QToolBar * toolbar_
Definition: qetprintpreviewdialog.h:75
QET::Icons::PrintPortrait
QIcon PrintPortrait
Definition: qeticons.cpp:141
QETPrintPreviewDialog::updatePreviewZoom
void updatePreviewZoom()
Definition: qetprintpreviewdialog.cpp:422
QETPrintPreviewDialog::use_full_page_label_
QLabel * use_full_page_label_
Definition: qetprintpreviewdialog.h:101
QETPrintPreviewDialog::single_page_view_
QAction * single_page_view_
Definition: qetprintpreviewdialog.h:96
QETPrintPreviewDialog::diagrams_select_all_
QPushButton * diagrams_select_all_
Definition: qetprintpreviewdialog.h:79
QETPrintPreviewDialog::setDiagramsListVisible
void setDiagramsListVisible(bool)
Definition: qetprintpreviewdialog.cpp:360
QETPrintPreviewDialog::diagrams_label_
QLabel * diagrams_label_
Definition: qetprintpreviewdialog.h:77
QETPrintPreviewDialog::lastPage
void lastPage()
Definition: qetprintpreviewdialog.cpp:103
QETProject
Definition: qetproject.h:51
QETPrintPreviewDialog::diagramsChooser
DiagramsChooser * diagramsChooser()
Definition: qetprintpreviewdialog.cpp:59
QETPrintPreviewDialog::zoom_out_
QAction * zoom_out_
Definition: qetprintpreviewdialog.h:87
QETPrintPreviewDialog::selectAllDiagrams
void selectAllDiagrams()
Definition: qetprintpreviewdialog.cpp:157
QETPrintPreviewDialog::previousPage
void previousPage()
Definition: qetprintpreviewdialog.cpp:87
QET::Icons::DocumentPrintFrame
QIcon DocumentPrintFrame
Definition: qeticons.cpp:57
QETPrintPreviewDialog::useFullPage
void useFullPage(bool)
Definition: qetprintpreviewdialog.cpp:122
QETPrintPreviewDialog::facing_pages_view_
QAction * facing_pages_view_
Definition: qetprintpreviewdialog.h:95
QETPrintPreviewDialog::hlayout0_
QHBoxLayout * hlayout0_
Definition: qetprintpreviewdialog.h:71
QETPrintPreviewDialog::fit_diagram_to_page_label_
QLabel * fit_diagram_to_page_label_
Definition: qetprintpreviewdialog.h:103
QET::Icons::PrintTwoPages
QIcon PrintTwoPages
Definition: qeticons.cpp:142
ExportProperties
Definition: exportproperties.h:27
QETPrintPreviewDialog::print_options_box_
QGroupBox * print_options_box_
Definition: qetprintpreviewdialog.h:99
QETPrintPreviewDialog::buttons_
QDialogButtonBox * buttons_
Definition: qetprintpreviewdialog.h:98
QETPrintPreviewDialog::page_setup_
QAction * page_setup_
Definition: qetprintpreviewdialog.h:97
QETPrintPreviewDialog::setPrintOptionsVisible
void setPrintOptionsVisible(bool)
Definition: qetprintpreviewdialog.cpp:378
QETPrintPreviewDialog::project_
QETProject * project_
Definition: qetprintpreviewdialog.h:69
diagramschooser.h
DiagramsChooser
Definition: diagramschooser.h:27
QETPrintPreviewDialog::diagrams_select_none_
QPushButton * diagrams_select_none_
Definition: qetprintpreviewdialog.h:80
QETPrintPreviewDialog::fitDiagramToPage
void fitDiagramToPage(bool)
Definition: qetprintpreviewdialog.cpp:132
QET::Icons::ArrowLeftDouble
QIcon ArrowLeftDouble
Definition: qeticons.cpp:29
QETPrintPreviewDialog::zoomOut
void zoomOut()
Definition: qetprintpreviewdialog.cpp:149
QET::Icons::SinglePage
QIcon SinglePage
Definition: qeticons.cpp:160
QETPrintPreviewDialog::zoom_box_
QComboBox * zoom_box_
Definition: qetprintpreviewdialog.h:86
ExportProperties::defaultPrintProperties
static ExportProperties defaultPrintProperties()
ExportProperties::defaultPrintProperties.
Definition: exportproperties.cpp:130
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
QETPrintPreviewDialog::adjust_page_
QAction * adjust_page_
Definition: qetprintpreviewdialog.h:84
QET::Icons::Diagram
QIcon Diagram
Definition: qeticons.cpp:43
QET::Icons::Cancel
QIcon Cancel
Definition: qeticons.cpp:34
QETPrintPreviewDialog::render_properties_
ExportPropertiesWidget * render_properties_
Definition: qetprintpreviewdialog.h:104
qetprintpreviewdialog.h