QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
exportdialog.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 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 EXPORTDIALOG_H
19#define EXPORTDIALOG_H
20#include <QtWidgets>
21#include "diagram.h"
22#include "qetproject.h"
23class QSvgGenerator;
30class ExportDialog : public QDialog {
31 Q_OBJECT
32
33 public:
34 // constructors, destructor
35 ExportDialog(QETProject *, QWidget * = nullptr);
36 ~ExportDialog() override;
37
38 // methods
39 int diagramsToExportCount() const;
40 static QPointF rotation_transformed(qreal, qreal, qreal, qreal, qreal);
41
42 private:
44
46 public:
47 ExportDiagramLine(Diagram *, QSize);
48 virtual ~ExportDiagramLine();
49 QBoxLayout *sizeLayout();
51 QCheckBox *must_export;
52 QLabel *title_label;
53 QLineEdit *file_name;
54 QSpinBox *width;
55 QLabel *x_label;
56 QSpinBox *height;
57 QPushButton *keep_ratio;
58 QPushButton *reset_size;
59 QPushButton *preview;
60 QPushButton *clipboard;
61 };
62
63 // attributes
64 private:
65 QHash<int, ExportDialog::ExportDiagramLine *> diagram_lines_;
66 // visual items
69 QDialogButtonBox *buttons;
70
71 QPushButton *selectAll;
72 QPushButton *deSelectAll;
73
74 // mappers
75 QSignalMapper *preview_mapper_;
76 QSignalMapper *width_mapper_;
77 QSignalMapper *height_mapper_;
78 QSignalMapper *ratio_mapper_;
79 QSignalMapper *reset_mapper_;
80 QSignalMapper *clipboard_mapper_;
81
82 // project whose diagrams are to be exported
84
85 // methods
86 QWidget *initDiagramsListPart();
87 void saveReloadDiagramParameters(Diagram *, bool = true);
88 void generateSvg(Diagram *, int, int, bool, QIODevice &);
89 void generateDxf(Diagram *, int, int, QString &);
90 QImage generateImage(Diagram *, int, int, bool);
92 qreal diagramRatio(Diagram *);
93 QSize diagramSize(Diagram *);
94
95 public slots:
96 void slot_correctWidth(int);
97 void slot_correctHeight(int);
98 void slot_keepRatioChanged(int);
99 void slot_resetSize(int);
100 void slot_export();
103 void slot_changeFilesExtension(bool = false);
104 void slot_previewDiagram(int);
105 void slot_exportToClipBoard(int);
108};
109#endif
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:56
Definition exportdialog.h:45
QPushButton * clipboard
Definition exportdialog.h:60
QPushButton * preview
Definition exportdialog.h:59
QPushButton * keep_ratio
Definition exportdialog.h:57
QPushButton * reset_size
Definition exportdialog.h:58
QLabel * x_label
Definition exportdialog.h:55
QCheckBox * must_export
Definition exportdialog.h:51
QBoxLayout * sizeLayout()
Definition exportdialog.cpp:1052
QLabel * title_label
Definition exportdialog.h:52
Diagram * diagram
Definition exportdialog.h:50
virtual ~ExportDiagramLine()
Definition exportdialog.cpp:1044
QSpinBox * height
Definition exportdialog.h:56
QSpinBox * width
Definition exportdialog.h:54
QLineEdit * file_name
Definition exportdialog.h:53
Definition exportdialog.h:30
QSignalMapper * width_mapper_
Definition exportdialog.h:76
QWidget * initDiagramsListPart()
Definition exportdialog.cpp:133
~ExportDialog() override
Definition exportdialog.cpp:113
QSignalMapper * ratio_mapper_
Definition exportdialog.h:78
void generateDxf(Diagram *, int, int, QString &)
Definition exportdialog.cpp:436
QPushButton * deSelectAll
Definition exportdialog.h:72
void slot_correctHeight(int)
Definition exportdialog.cpp:274
QGridLayout * diagrams_list_layout_
Definition exportdialog.h:67
QPushButton * selectAll
Definition exportdialog.h:71
void slot_deSelectAllClicked()
Definition exportdialog.cpp:204
void saveReloadDiagramParameters(Diagram *, bool=true)
Definition exportdialog.cpp:374
int diagramsToExportCount() const
Definition exportdialog.cpp:120
qreal diagramRatio(Diagram *)
Definition exportdialog.cpp:217
void slot_previewDiagram(int)
Definition exportdialog.cpp:901
QSize diagramSize(Diagram *)
Definition exportdialog.cpp:229
QHash< int, ExportDialog::ExportDiagramLine * > diagram_lines_
Definition exportdialog.h:65
void slot_selectAllClicked()
Definition exportdialog.cpp:197
void slot_export()
Definition exportdialog.cpp:710
void exportDiagram(ExportDiagramLine *)
Definition exportdialog.cpp:768
void slot_changeFilesExtension(bool=false)
Definition exportdialog.cpp:867
void slot_checkDiagramsCount()
Definition exportdialog.cpp:856
QSignalMapper * reset_mapper_
Definition exportdialog.h:79
void generateSvg(Diagram *, int, int, bool, QIODevice &)
Definition exportdialog.cpp:394
QSignalMapper * height_mapper_
Definition exportdialog.h:77
void slot_exportToClipBoard(int)
Definition exportdialog.cpp:950
void slot_changeUseBorder()
Definition exportdialog.cpp:837
static QPointF rotation_transformed(qreal, qreal, qreal, qreal, qreal)
Definition exportdialog.cpp:685
QSignalMapper * preview_mapper_
Definition exportdialog.h:75
QETProject * project_
Definition exportdialog.h:83
void slot_resetSize(int)
Definition exportdialog.cpp:321
QDialogButtonBox * buttons
Definition exportdialog.h:69
void slot_correctWidth(int)
Definition exportdialog.cpp:250
ExportDialog(const ExportDialog &)
void slot_keepRatioChanged(int)
Definition exportdialog.cpp:297
ExportPropertiesWidget * epw
Definition exportdialog.h:68
QSignalMapper * clipboard_mapper_
Definition exportdialog.h:80
QImage generateImage(Diagram *, int, int, bool)
Definition exportdialog.cpp:347
Definition exportpropertieswidget.h:27
Definition qetproject.h:62