QElectroTech  0.8-dev
templatecellwidget.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 TITLEBLOCK_SLASH_TEMPLATE_CELL_WIDGET_H
19 #define TITLEBLOCK_SLASH_TEMPLATE_CELL_WIDGET_H
20 #include <QtWidgets>
21 #include "qet.h"
23 class TitleBlockTemplate;
24 class TitleBlockCell;
25 class NamesList;
26 
32 class TitleBlockTemplateCellWidget : public QWidget {
33  Q_OBJECT
34 
35  // constructor, destructor
36  public:
38  QWidget * = nullptr);
40  private:
43 
44  // attributes
45  private:
47  bool read_only_;
49  QComboBox *cell_type_input_;
50 
51  QLabel *empty_label_;
52 
53  QLabel *logo_label_;
54  QComboBox *logo_input_;
55  QPushButton *add_logo_input_;
56 
57  QLabel *name_label_;
58  QLineEdit *name_input_;
59  QCheckBox *label_checkbox_;
60  QLineEdit *label_input_;
61  QPushButton *label_edit_;
62  QLabel *value_label_;
63  QLineEdit *value_input_;
64  QPushButton *value_edit_;
65  QLabel *align_label_;
67  QComboBox *horiz_align_input_;
68  QHash<int, int> horiz_align_indexes_;
70  QComboBox *vert_align_input_;
71  QHash<int, int> vert_align_indexes_;
73  QSpinBox *font_size_input_;
74  QCheckBox *font_adjust_input_;
75  QVBoxLayout *cell_editor_layout_;
79 
81 
82  // methods
83  public:
84  int horizontalAlignment() const;
85  int verticalAlignment() const;
86  int alignment() const;
87  bool isReadOnly() const;
88 
89  protected:
91  const QString &,
92  const QString &) const;
93  void emitModification(const QString &,
94  const QVariant &) const;
95  QString defaultVariablesString() const;
96  QString labelValueInformationString() const;
97 
98  private:
99  void initWidgets();
100 
101  public slots:
102  void updateFormType(int);
103  void edit(TitleBlockCell *);
104  void editType();
105  void editName();
106  void editLabelDisplayed();
107  void editLabel();
108  void editValue();
109  void editAlignment();
110  void editFontSize();
111  void editAdjust();
112  void editLogo();
114  void setReadOnly(bool);
115 
116  private slots:
117 
118 
119  signals:
122 };
123 
124 #endif
TitleBlockTemplateCellWidget::editLabel
void editLabel()
Definition: templatecellwidget.cpp:252
TitleBlockTemplateCellWidget::align_label_
QLabel * align_label_
Definition: templatecellwidget.h:65
TitleBlockTemplateCellWidget::TitleBlockTemplateCellWidget
TitleBlockTemplateCellWidget(const TitleBlockTemplateCellWidget &)
TitleBlockTemplateCellWidget::label_checkbox_
QCheckBox * label_checkbox_
Definition: templatecellwidget.h:59
TitleBlockTemplateCellWidget::logoEditionRequested
void logoEditionRequested()
TitleBlockTemplateCellWidget::editFontSize
void editFontSize()
Definition: templatecellwidget.cpp:280
NameListDialog::setHelpText
void setHelpText(const QString &text)
Definition: namelistdialog.cpp:55
TitleBlockTemplateCellWidget::name_label_
QLabel * name_label_
Definition: templatecellwidget.h:57
nameslist.h
TitleBlockTemplateCellWidget::cell_type_input_
QComboBox * cell_type_input_
Definition: templatecellwidget.h:49
TitleBlockTemplateCellWidget::label_edit_
QPushButton * label_edit_
Definition: templatecellwidget.h:61
qetinformation.h
TitleBlockTemplateCellWidget::editType
void editType()
Definition: templatecellwidget.cpp:228
TitleBlockTemplateCellWidget::~TitleBlockTemplateCellWidget
~TitleBlockTemplateCellWidget() override
Definition: templatecellwidget.cpp:47
QETInformation::titleblockTranslatedKeyHashVar
QHash< QString, QString > titleblockTranslatedKeyHashVar()
QETInformation::titleblockTranslatedKeyHashVar.
Definition: qetinformation.cpp:121
TitleBlockTemplateCellWidget::font_size_input_
QSpinBox * font_size_input_
Definition: templatecellwidget.h:73
TitleBlockTemplateCellWidget::edited_cell_
TitleBlockCell * edited_cell_
Definition: templatecellwidget.h:80
TitleBlockTemplateCellWidget::horiz_align_indexes_
QHash< int, int > horiz_align_indexes_
Definition: templatecellwidget.h:68
TitleBlockTemplateCellWidget::editAdjust
void editAdjust()
Definition: templatecellwidget.cpp:288
TitleBlockTemplateCellWidget::updateFormType
void updateFormType(int)
Definition: templatecellwidget.cpp:166
TitleBlockTemplateCellWidget::name_input_
QLineEdit * name_input_
Definition: templatecellwidget.h:58
TitleBlockTemplateCellWidget::read_only_
bool read_only_
is the template read-only?
Definition: templatecellwidget.h:47
TitleBlockTemplateCellWidget::font_adjust_input_
QCheckBox * font_adjust_input_
Definition: templatecellwidget.h:74
NameListDialog::setInformationText
void setInformationText(const QString &text)
Definition: namelistdialog.cpp:42
TitleBlockTemplateCellWidget::cell_editor_type_and_name_layout_
QHBoxLayout * cell_editor_type_and_name_layout_
Definition: templatecellwidget.h:76
TitleBlockTemplateCellWidget::horiz_align_label_
QLabel * horiz_align_label_
Definition: templatecellwidget.h:66
TitleBlockTemplateCellWidget::edit
void edit(TitleBlockCell *)
Definition: templatecellwidget.cpp:203
TitleBlockCell::TextCell
@ TextCell
Definition: titleblockcell.h:30
TitleBlockTemplateCellWidget::labelValueInformationString
QString labelValueInformationString() const
Definition: templatecellwidget.cpp:458
TitleBlockTemplateCellWidget::cell_type_label_
QLabel * cell_type_label_
Definition: templatecellwidget.h:48
TitleBlockTemplateCellWidget::horiz_align_input_
QComboBox * horiz_align_input_
Definition: templatecellwidget.h:67
templatecellwidget.h
namelistdialog.h
TitleBlockTemplate::fontForCell
static QFont fontForCell(const TitleBlockCell &)
TitleBlockTemplate::fontForCell.
Definition: titleblocktemplate.cpp:80
NameListDialog
The NameListDialog class Provide a dialog for let user define localized string;.
Definition: namelistdialog.h:34
TitleBlockTemplate
The TitleBlockTemplate class This class represents an title block template for an electric diagram....
Definition: titleblocktemplate.h:36
templatecommands.h
TitleBlockTemplateCellWidget::cell_editor_text_layout_
QGridLayout * cell_editor_text_layout_
Definition: templatecellwidget.h:77
TitleBlockTemplateCellWidget::TitleBlockTemplateCellWidget
TitleBlockTemplateCellWidget(TitleBlockTemplate *=nullptr, QWidget *=nullptr)
TitleBlockTemplateCellWidget::TitleBlockTemplateCellWidget Constructor.
Definition: templatecellwidget.cpp:34
qeticons.h
TitleBlockTemplateCellWidget::value_label_
QLabel * value_label_
Definition: templatecellwidget.h:62
TitleBlockTemplateCellWidget::font_size_label_
QLabel * font_size_label_
Definition: templatecellwidget.h:72
qet.h
ModifyTitleBlockCellCommand
Definition: templatecommands.h:33
TitleBlockTemplateCellWidget::editLogo
void editLogo()
Definition: templatecellwidget.cpp:296
TitleBlockTemplateCellWidget::defaultVariablesString
QString defaultVariablesString() const
Definition: templatecellwidget.cpp:426
TitleBlockTemplateCellWidget::updateLogosComboBox
void updateLogosComboBox(const TitleBlockTemplate *)
Definition: templatecellwidget.cpp:304
TitleBlockCell::EmptyCell
@ EmptyCell
Definition: titleblockcell.h:29
TitleBlockTemplateCellWidget::vert_align_indexes_
QHash< int, int > vert_align_indexes_
Definition: templatecellwidget.h:71
TitleBlockTemplateCellWidget::vert_align_input_
QComboBox * vert_align_input_
Definition: templatecellwidget.h:70
TitleBlockTemplateCellWidget::value_edit_
QPushButton * value_edit_
Definition: templatecellwidget.h:64
titleblockcell.h
TitleBlockTemplateCellWidget
The TitleBlockTemplateCellWidget class This class implements an edition widget for cells that compose...
Definition: templatecellwidget.h:32
TitleBlockTemplateCellWidget::editAlignment
void editAlignment()
Definition: templatecellwidget.cpp:272
TitleBlockTemplateCellWidget::empty_label_
QLabel * empty_label_
Definition: templatecellwidget.h:51
TitleBlockTemplateCellWidget::cell_editor_layout_
QVBoxLayout * cell_editor_layout_
Definition: templatecellwidget.h:75
TitleBlockTemplateCellWidget::logo_input_
QComboBox * logo_input_
Definition: templatecellwidget.h:54
NameListWidget::names
NamesList names() const
NameListWidget::names.
Definition: namelistwidget.cpp:82
TitleBlockCell::LogoCell
@ LogoCell
Definition: titleblockcell.h:31
TitleBlockTemplateCellWidget::vert_align_label_
QLabel * vert_align_label_
Definition: templatecellwidget.h:69
TitleBlockTemplateCellWidget::isReadOnly
bool isReadOnly() const
Definition: templatecellwidget.cpp:371
TitleBlockTemplateCellWidget::cellModified
void cellModified(ModifyTitleBlockCellCommand *) const
TitleBlockTemplateCellWidget::editValue
void editValue()
Definition: templatecellwidget.cpp:262
NamesList
Definition: nameslist.h:30
QET::Icons::InsertImage
QIcon InsertImage
Definition: qeticons.cpp:116
TitleBlockCell::attributeName
static QString attributeName(const QString &)
Definition: titleblockcell.cpp:108
TitleBlockTemplateCellWidget::editLabelDisplayed
void editLabelDisplayed()
Definition: templatecellwidget.cpp:244
NameListWidget::setClipboardValue
void setClipboardValue(QHash< QString, QString > value)
Definition: namelistwidget.cpp:129
TitleBlockTemplateCellWidget::setReadOnly
void setReadOnly(bool)
Definition: templatecellwidget.cpp:329
TitleBlockTemplateCellWidget::cell_editor_image_layout_
QHBoxLayout * cell_editor_image_layout_
Definition: templatecellwidget.h:78
TitleBlockTemplateCellWidget::emitModification
void emitModification(const QString &, const QVariant &) const
Definition: templatecellwidget.cpp:407
NameListWidget
The NameListWidget class Provide a widget for let user define localized string;.
Definition: namelistwidget.h:33
NameListWidget::setNames
void setNames(const NamesList &name_list)
NameListWidget::setNames Set the current names of this dialog from name_list.
Definition: namelistwidget.cpp:60
namelistwidget.h
titleblocktemplate.h
TitleBlockTemplateCellWidget::logo_label_
QLabel * logo_label_
Definition: templatecellwidget.h:53
TitleBlockTemplateCellWidget::horizontalAlignment
int horizontalAlignment() const
Definition: templatecellwidget.cpp:349
TitleBlockTemplateCellWidget::editTranslatableValue
void editTranslatableValue(NamesList &, const QString &, const QString &) const
Definition: templatecellwidget.cpp:383
TitleBlockTemplateCellWidget::label_input_
QLineEdit * label_input_
Definition: templatecellwidget.h:60
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
TitleBlockTemplateCellWidget::verticalAlignment
int verticalAlignment() const
Definition: templatecellwidget.cpp:357
TitleBlockCell
Definition: titleblockcell.h:26
TitleBlockTemplateCellWidget::add_logo_input_
QPushButton * add_logo_input_
Definition: templatecellwidget.h:55
TitleBlockTemplateCellWidget::value_input_
QLineEdit * value_input_
Definition: templatecellwidget.h:63
NameListDialog::namelistWidget
NameListWidget * namelistWidget() const
NameListDialog::namelistWidget.
Definition: namelistdialog.cpp:51
TitleBlockTemplateCellWidget::alignment
int alignment() const
Definition: templatecellwidget.cpp:364
TitleBlockTemplateCellWidget::initWidgets
void initWidgets()
Definition: templatecellwidget.cpp:53
TitleBlockTemplateCellWidget::editName
void editName()
Definition: templatecellwidget.cpp:236