QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
templatecellwidget.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 TITLEBLOCK_SLASH_TEMPLATE_CELL_WIDGET_H
19#define TITLEBLOCK_SLASH_TEMPLATE_CELL_WIDGET_H
20#include "../qet.h"
21
22#include <QtWidgets>
25class TitleBlockCell;
26class NamesList;
27
33class TitleBlockTemplateCellWidget : public QWidget {
34 Q_OBJECT
35
36 // constructor, destructor
37 public:
39 TitleBlockTemplate * = nullptr,
40 QWidget * = nullptr);
42 private:
45
46 // attributes
47 private:
51 QComboBox *cell_type_input_;
52
53 QLabel *empty_label_;
54
55 QLabel *logo_label_;
56 QComboBox *logo_input_;
57 QPushButton *add_logo_input_;
58
59 QLabel *name_label_;
60 QLineEdit *name_input_;
61 QCheckBox *label_checkbox_;
62 QLineEdit *label_input_;
63 QPushButton *label_edit_;
64 QLabel *value_label_;
65 QLineEdit *value_input_;
66 QPushButton *value_edit_;
67 QLabel *align_label_;
70 QHash<int, int> horiz_align_indexes_;
73 QHash<int, int> vert_align_indexes_;
77 QVBoxLayout *cell_editor_layout_;
81
83
84 // methods
85 public:
86 int horizontalAlignment() const;
87 int verticalAlignment() const;
88 int alignment() const;
89 bool isReadOnly() const;
90
91 protected:
93 const QString &,
94 const QString &) const;
95 void emitModification(const QString &,
96 const QVariant &) const;
97 QString defaultVariablesString() const;
98 QString labelValueInformationString() const;
99
100 private:
101 void initWidgets();
102
103 public slots:
104 void updateFormType(int);
105 void edit(TitleBlockCell *);
106 void editType();
107 void editName();
108 void editLabelDisplayed();
109 void editLabel();
110 void editValue();
111 void editAlignment();
112 void editFontSize();
113 void editAdjust();
114 void editLogo();
116 void setReadOnly(bool);
117
118 private slots:
119
120
121 signals:
124};
125
126#endif
Definition templatecommands.h:34
Definition nameslist.h:31
Definition titleblockcell.h:26
The TitleBlockTemplateCellWidget class This class implements an edition widget for cells that compose...
Definition templatecellwidget.h:33
QLabel * font_size_label_
Definition templatecellwidget.h:74
TitleBlockCell * edited_cell_
Definition templatecellwidget.h:82
void editValue()
Definition templatecellwidget.cpp:269
QLabel * cell_type_label_
Definition templatecellwidget.h:50
~TitleBlockTemplateCellWidget() override
Definition templatecellwidget.cpp:48
int horizontalAlignment() const
Definition templatecellwidget.cpp:361
QComboBox * cell_type_input_
Definition templatecellwidget.h:51
void editFontSize()
Definition templatecellwidget.cpp:289
void setReadOnly(bool)
Definition templatecellwidget.cpp:341
QCheckBox * label_checkbox_
Definition templatecellwidget.h:61
QLabel * empty_label_
Definition templatecellwidget.h:53
int verticalAlignment() const
Definition templatecellwidget.cpp:370
void cellModified(ModifyTitleBlockCellCommand *) const
void updateLogosComboBox(const TitleBlockTemplate *)
Definition templatecellwidget.cpp:316
QLabel * align_label_
Definition templatecellwidget.h:67
void emitModification(const QString &, const QVariant &) const
Definition templatecellwidget.cpp:423
QLineEdit * label_input_
Definition templatecellwidget.h:62
QPushButton * label_edit_
Definition templatecellwidget.h:63
QSpinBox * font_size_input_
Definition templatecellwidget.h:75
QLabel * horiz_align_label_
Definition templatecellwidget.h:68
void editLabel()
Definition templatecellwidget.cpp:258
int alignment() const
Definition templatecellwidget.cpp:378
bool isReadOnly() const
Definition templatecellwidget.cpp:386
QLabel * vert_align_label_
Definition templatecellwidget.h:71
TitleBlockTemplateCellWidget(const TitleBlockTemplateCellWidget &)
QGridLayout * cell_editor_text_layout_
Definition templatecellwidget.h:79
void editAdjust()
Definition templatecellwidget.cpp:298
QHash< int, int > horiz_align_indexes_
Definition templatecellwidget.h:70
void editType()
Definition templatecellwidget.cpp:231
QLabel * value_label_
Definition templatecellwidget.h:64
QPushButton * value_edit_
Definition templatecellwidget.h:66
QLineEdit * value_input_
Definition templatecellwidget.h:65
void editLogo()
Definition templatecellwidget.cpp:307
QPushButton * add_logo_input_
Definition templatecellwidget.h:57
QHBoxLayout * cell_editor_image_layout_
Definition templatecellwidget.h:80
QComboBox * vert_align_input_
Definition templatecellwidget.h:72
QString labelValueInformationString() const
Definition templatecellwidget.cpp:478
QLabel * name_label_
Definition templatecellwidget.h:59
void editTranslatableValue(NamesList &, const QString &, const QString &) const
Definition templatecellwidget.cpp:399
void editAlignment()
Definition templatecellwidget.cpp:280
QComboBox * logo_input_
Definition templatecellwidget.h:56
QLineEdit * name_input_
Definition templatecellwidget.h:60
bool read_only_
is the template read-only?
Definition templatecellwidget.h:49
void editLabelDisplayed()
Definition templatecellwidget.cpp:249
QCheckBox * font_adjust_input_
Definition templatecellwidget.h:76
void editName()
Definition templatecellwidget.cpp:240
void edit(TitleBlockCell *)
Definition templatecellwidget.cpp:206
QString defaultVariablesString() const
Definition templatecellwidget.cpp:443
QLabel * logo_label_
Definition templatecellwidget.h:55
void updateFormType(int)
Definition templatecellwidget.cpp:169
QComboBox * horiz_align_input_
Definition templatecellwidget.h:69
QHBoxLayout * cell_editor_type_and_name_layout_
Definition templatecellwidget.h:78
QVBoxLayout * cell_editor_layout_
Definition templatecellwidget.h:77
void initWidgets()
Definition templatecellwidget.cpp:55
QHash< int, int > vert_align_indexes_
Definition templatecellwidget.h:73
The TitleBlockTemplate class This class represents an title block template for an electric diagram....
Definition titleblocktemplate.h:37