QElectroTech  0.8-dev
dynamictextfieldeditor.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 DYNAMICTEXTFIELDEDITOR_H
19 #define DYNAMICTEXTFIELDEDITOR_H
20 
21 #include "elementitemeditor.h"
22 #include "partdynamictextfield.h"
23 
24 namespace Ui {
26 }
27 
33  Q_OBJECT
34 
35  public:
36  explicit DynamicTextFieldEditor(QETElementEditor *editor, PartDynamicTextField *text_field = nullptr, QWidget *parent = nullptr);
37  ~DynamicTextFieldEditor() override;
38 
39  bool setPart(CustomElementPart *part) override;
40  bool setParts(QList <CustomElementPart *>) override;
41  CustomElementPart *currentPart() const override;
42  QList<CustomElementPart*> currentParts() const override;
43  void updateForm() override;
44 
45  private:
46  void fillInfoComboBox();
47  void setUpConnections();
48  void disconnectConnections();
49 
50  private slots:
56  void on_m_frame_cb_clicked();
58  void on_m_elmt_info_cb_activated(const QString &arg1);
59  void on_m_text_from_cb_activated(int index);
62  void on_m_font_pb_clicked();
63 
64  void on_m_color_kpb_changed(const QColor &newColor);
65 
66  private:
67  Ui::DynamicTextFieldEditor *ui;
68  QPointer<PartDynamicTextField> m_text_field;
69  QList<PartDynamicTextField*> m_parts;
70  QList<QMetaObject::Connection> m_connection_list;
71 };
72 
73 #endif // DYNAMICTEXTFIELDEDITOR_H
elementitemeditor.h
DynamicTextFieldEditor::ui
Ui::DynamicTextFieldEditor * ui
Definition: dynamictextfieldeditor.h:67
PartDynamicTextField::compositeTextChanged
void compositeTextChanged(QString text)
DynamicTextFieldEditor
The DynamicTextFieldEditor class This class provide a widget used to edit the property of a dynamic t...
Definition: dynamictextfieldeditor.h:32
DynamicTextFieldEditor::on_m_font_pb_clicked
void on_m_font_pb_clicked()
Definition: dynamictextfieldeditor.cpp:367
DynamicTextFieldEditor::fillInfoComboBox
void fillInfoComboBox()
DynamicTextFieldEditor::fillInfoComboBox Fill the combo box "element information".
Definition: dynamictextfieldeditor.cpp:193
DynamicTextFieldEditor::setUpConnections
void setUpConnections()
Definition: dynamictextfieldeditor.cpp:155
QETApp::elementInfoKeys
static QStringList elementInfoKeys()
QETApp::elementInfoKeys.
Definition: qetapp.cpp:366
CompositeTextEditDialog
The CompositeTextEditDialog class CompositeTextEditDialog display a dialog use to write the complex t...
Definition: compositetexteditdialog.h:20
alignmenttextdialog.h
DynamicTextFieldEditor::on_m_frame_cb_clicked
void on_m_frame_cb_clicked()
Definition: dynamictextfieldeditor.cpp:264
DynamicTextFieldEditor::on_m_rotation_sb_editingFinished
void on_m_rotation_sb_editingFinished()
Definition: dynamictextfieldeditor.cpp:235
PartDynamicTextField::frameChanged
void frameChanged(bool frame)
dynamictextfieldeditor.h
qetapp.h
qetelementeditor.h
DynamicTextFieldEditor::~DynamicTextFieldEditor
~DynamicTextFieldEditor() override
Definition: dynamictextfieldeditor.cpp:46
QETApp::elementTranslatedInfoKey
static QString elementTranslatedInfoKey(const QString &)
ElementsProperties::translatedInfo Return the translated information key given by info If info don't ...
Definition: qetapp.cpp:400
ElementItemEditor
Definition: elementitemeditor.h:34
ElementItemEditor::elementScene
virtual ElementScene * elementScene() const
Definition: elementitemeditor.cpp:39
DynamicTextFieldEditor::on_m_composite_text_pb_clicked
void on_m_composite_text_pb_clicked()
Definition: dynamictextfieldeditor.cpp:338
DynamicTextFieldEditor::on_m_y_sb_editingFinished
void on_m_y_sb_editingFinished()
Definition: dynamictextfieldeditor.cpp:225
DynamicTextFieldEditor::currentPart
CustomElementPart * currentPart() const override
DynamicTextFieldEditor::currentPart.
Definition: dynamictextfieldeditor.cpp:111
QET::correctAngle
qreal correctAngle(const qreal &)
Definition: qet.cpp:545
PartDynamicTextField::textWidthChanged
void textWidthChanged(qreal width)
PartDynamicTextField
The PartDynamicTextField class This class represents an editable dynamic text field which may be used...
Definition: partdynamictextfield.h:34
DynamicTextFieldEditor::on_m_x_sb_editingFinished
void on_m_x_sb_editingFinished()
Definition: dynamictextfieldeditor.cpp:215
compositetexteditdialog.h
DynamicTextFieldEditor::m_text_field
QPointer< PartDynamicTextField > m_text_field
Definition: dynamictextfieldeditor.h:68
ElementItemEditor::elementEditor
virtual QETElementEditor * elementEditor() const
Definition: elementitemeditor.cpp:34
DynamicTextFieldEditor::setParts
bool setParts(QList< CustomElementPart * >) override
Definition: dynamictextfieldeditor.cpp:78
DynamicElementTextItem::CompositeText
@ CompositeText
Definition: dynamicelementtextitem.h:58
DynamicTextFieldEditor::on_m_user_text_le_editingFinished
void on_m_user_text_le_editingFinished()
Definition: dynamictextfieldeditor.cpp:245
qpropertyundocommand.h
DynamicTextFieldEditor::m_connection_list
QList< QMetaObject::Connection > m_connection_list
Definition: dynamictextfieldeditor.h:70
DynamicElementTextItem::TextFrom
TextFrom
Definition: dynamicelementtextitem.h:55
DynamicElementTextItem::UserText
@ UserText
Definition: dynamicelementtextitem.h:56
DynamicTextFieldEditor::m_parts
QList< PartDynamicTextField * > m_parts
Definition: dynamictextfieldeditor.h:69
DynamicTextFieldEditor::on_m_alignment_pb_clicked
void on_m_alignment_pb_clicked()
Definition: dynamictextfieldeditor.cpp:352
Ui
Definition: autonumberingdockwidget.h:25
DynamicTextFieldEditor::currentParts
QList< CustomElementPart * > currentParts() const override
Definition: dynamictextfieldeditor.cpp:115
DynamicTextFieldEditor::on_m_text_from_cb_activated
void on_m_text_from_cb_activated(int index)
Definition: dynamictextfieldeditor.cpp:303
DynamicTextFieldEditor::on_m_size_sb_editingFinished
void on_m_size_sb_editingFinished()
Definition: dynamictextfieldeditor.cpp:254
PartDynamicTextField::fontChanged
void fontChanged(QFont font)
CustomElementPart
The CustomElementPart class This abstract class represents a primitive of the visual representation o...
Definition: customelementpart.h:40
DynamicTextFieldEditor::updateForm
void updateForm() override
Definition: dynamictextfieldeditor.cpp:123
DynamicTextFieldEditor::setPart
bool setPart(CustomElementPart *part) override
DynamicTextFieldEditor::setPart Set part as current edited part of this widget.
Definition: dynamictextfieldeditor.cpp:61
DynamicTextFieldEditor::on_m_color_kpb_changed
void on_m_color_kpb_changed(const QColor &newColor)
Definition: dynamictextfieldeditor.cpp:382
PartDynamicTextField::taggChanged
void taggChanged(QString tagg)
PartDynamicTextField::colorChanged
void colorChanged(QColor color)
AlignmentTextDialog::alignment
Qt::Alignment alignment() const
AlignmentTextDialog::alignment.
Definition: alignmenttextdialog.cpp:57
PartDynamicTextField::textFromChanged
void textFromChanged(DynamicElementTextItem::TextFrom text_from)
PartDynamicTextField::Type
@ Type
Definition: partdynamictextfield.h:67
DynamicTextFieldEditor::DynamicTextFieldEditor
DynamicTextFieldEditor(QETElementEditor *editor, PartDynamicTextField *text_field=nullptr, QWidget *parent=nullptr)
Definition: dynamictextfieldeditor.cpp:33
QPropertyUndoCommand
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition: qpropertyundocommand.h:34
CompositeTextEditDialog::plainText
QString plainText() const
CompositeTextEditDialog::plainText.
Definition: compositetexteditdialog.cpp:41
PartDynamicTextField::textChanged
void textChanged(QString text)
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
customelementpart.h
DynamicElementTextItem::ElementInfo
@ ElementInfo
Definition: dynamicelementtextitem.h:57
AlignmentTextDialog
Definition: alignmenttextdialog.h:28
partdynamictextfield.h
QETElementEditor
Definition: qetelementeditor.h:33
PartDynamicTextField::infoNameChanged
void infoNameChanged(QString info)
DynamicTextFieldEditor::disconnectConnections
void disconnectConnections()
Definition: dynamictextfieldeditor.cpp:180
DynamicTextFieldEditor::on_m_elmt_info_cb_activated
void on_m_elmt_info_cb_activated(const QString &arg1)
Definition: dynamictextfieldeditor.cpp:288
ElementItemEditor::undoStack
virtual QUndoStack & undoStack() const
Definition: elementitemeditor.cpp:44
DynamicTextFieldEditor::on_m_width_sb_editingFinished
void on_m_width_sb_editingFinished()
Definition: dynamictextfieldeditor.cpp:276