QElectroTech  0.8-dev
dynamicelementtextitemeditor.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 DYNAMICELEMENTTEXTITEMEDITOR_H
19 #define DYNAMICELEMENTTEXTITEMEDITOR_H
20 
22 
25 class QStandardItem;
27 
28 namespace Ui {
30 }
31 
33 {
34  Q_OBJECT
35 
36  public:
38  Element *element,
39  QWidget *parent = nullptr);
41 
42  void setElement(Element *element) override;
43  QString title() const override {return tr("Textes");}
44  bool setLiveEdit(bool live_edit) override;
45  void apply() override;
48  QUndoCommand *associatedUndo() const override;
49 
50  private:
51  void dataEdited();
52 
53  private slots:
54  void on_m_add_text_clicked();
57  void on_m_tree_view_clicked(const QModelIndex &index);
60 
61  private:
62  Ui::DynamicElementTextItemEditor *ui;
64 };
65 
66 #endif // DYNAMICELEMENTTEXTITEMEDITOR_H
DynamicElementTextItemEditor::title
QString title() const override
PropertiesEditorWidget::title.
Definition: dynamicelementtextitemeditor.h:43
DynamicElementTextItemEditor
Definition: dynamicelementtextitemeditor.h:33
DynamicElementTextModel::indexFromText
QModelIndex indexFromText(DynamicElementTextItem *text) const
DynamicElementTextModel::indexFromText.
Definition: dynamicelementtextmodel.cpp:478
DynamicElementTextItemEditor::~DynamicElementTextItemEditor
~DynamicElementTextItemEditor() override
Definition: dynamicelementtextitemeditor.cpp:46
DynamicElementTextItem
The DynamicElementTextItem class This class provide a simple text field of element who can be added o...
Definition: dynamicelementtextitem.h:39
DynamicElementTextItemEditor::on_m_add_group_clicked
void on_m_add_group_clicked()
DynamicElementTextItemEditor::on_m_add_group_clicked Add a new group.
Definition: dynamicelementtextitemeditor.cpp:242
PropertiesEditorWidget::m_live_edit
bool m_live_edit
Definition: propertieseditorwidget.h:50
dynamicelementtextitemeditor.h
DynamicElementTextModel::groupFromIndex
ElementTextItemGroup * groupFromIndex(const QModelIndex &index) const
DynamicElementTextModel::groupFromIndex.
Definition: dynamicelementtextmodel.cpp:887
DeleteQGraphicsItemCommand
Definition: deleteqgraphicsitemcommand.h:31
DynamicElementTextModel::textFromIndex
DynamicElementTextItem * textFromIndex(const QModelIndex &index) const
DynamicElementTextModel::textFromIndex.
Definition: dynamicelementtextmodel.cpp:404
DynamicElementTextItemEditor::setCurrentGroup
void setCurrentGroup(ElementTextItemGroup *group)
DynamicElementTextItemEditor::setCurrentGroup Expand and select the item for group group.
Definition: dynamicelementtextitemeditor.cpp:159
elementtextitemgroup.h
DynamicElementTextModel
The DynamicElementTextModel class A model to use with QtView. This model display and can edit the val...
Definition: dynamicelementtextmodel.h:36
DiagramContent
Definition: diagramcontent.h:46
abstractelementpropertieseditorwidget.h
dynamicelementtextmodel.h
DynamicElementTextModel::indexIsText
bool indexIsText(const QModelIndex &index) const
DynamicElementTextModel::indexIsText.
Definition: dynamicelementtextmodel.cpp:948
DynamicElementTextItemEditor::ui
Ui::DynamicElementTextItemEditor * ui
Definition: dynamicelementtextitemeditor.h:62
DynamicElementTextItemEditor::DynamicElementTextItemEditor
DynamicElementTextItemEditor(Element *element, QWidget *parent=nullptr)
Definition: dynamicelementtextitemeditor.cpp:34
addelementtextcommand.h
DynamicElementTextItemEditor::on_m_remove_selection_clicked
void on_m_remove_selection_clicked()
DynamicElementTextItemEditor::on_m_remove_selection_clicked Remove the selected item.
Definition: dynamicelementtextitemeditor.cpp:220
AddTextsGroupCommand
The AddTextsGroupCommand class Manage the adding of a texts group.
Definition: addelementtextcommand.h:54
DynamicElementTextItemEditor::associatedUndo
QUndoCommand * associatedUndo() const override
PropertiesEditorWidget::associatedUndo By default, return a nullptr.
Definition: dynamicelementtextitemeditor.cpp:170
ImportElementTextPattern
Definition: elementtextpattern.h:43
DynamicElementTextItemEditor::on_m_tree_view_clicked
void on_m_tree_view_clicked(const QModelIndex &index)
Definition: dynamicelementtextitemeditor.cpp:252
DynamicElementTextItemEditor::on_m_export_pb_clicked
void on_m_export_pb_clicked()
Definition: dynamicelementtextitemeditor.cpp:260
DynamicElementTextItemEditor::setLiveEdit
bool setLiveEdit(bool live_edit) override
PropertiesEditorWidget::setLiveEdit Set the editor in live edit mode. When an editor is in live edit ...
Definition: dynamicelementtextitemeditor.cpp:67
DynamicElementTextItemEditor::apply
void apply() override
Definition: dynamicelementtextitemeditor.cpp:73
AbstractElementPropertiesEditorWidget
The AbstractElementPropertiesEditorWidget class This class provide common method for all widget used ...
Definition: abstractelementpropertieseditorwidget.h:31
element.h
DynamicElementTextItemEditor::setElement
void setElement(Element *element) override
Definition: dynamicelementtextitemeditor.cpp:51
qpropertyundocommand.h
RemoveTextsGroupCommand
The RemoveTextsGroupCommand class Manage the removinf of a texts group.
Definition: addelementtextcommand.h:85
Element
Definition: element.h:41
DynamicElementTextItemEditor::setCurrentText
void setCurrentText(DynamicElementTextItem *text)
DynamicElementTextItemEditor::setCurrentText Expand and select the item for text text.
Definition: dynamicelementtextitemeditor.cpp:142
elementtextpattern.h
ExportElementTextPattern
Definition: elementtextpattern.h:28
Ui
Definition: autonumberingdockwidget.h:25
DynamicElementTextItemEditor::on_m_import_pb_clicked
void on_m_import_pb_clicked()
Definition: dynamicelementtextitemeditor.cpp:265
DynamicTextItemDelegate
Definition: dynamicelementtextmodel.h:131
DiagramContent::m_element_texts
QSet< DynamicElementTextItem * > m_element_texts
Definition: diagramcontent.h:77
ElementTextItemGroup
The ElementTextItemGroup class This class represent a group of element text Texts in the group can be...
Definition: elementtextitemgroup.h:36
DynamicElementTextModel::undoForEditedGroup
QUndoCommand * undoForEditedGroup(ElementTextItemGroup *group, QUndoCommand *parent_undo=nullptr) const
DynamicElementTextModel::undoForEditedGroup.
Definition: dynamicelementtextmodel.cpp:625
DynamicElementTextItemEditor::on_m_add_text_clicked
void on_m_add_text_clicked()
DynamicElementTextItemEditor::on_m_add_text_clicked Add a new dynamic text.
Definition: dynamicelementtextitemeditor.cpp:199
DynamicElementTextModel::indexFromGroup
QModelIndex indexFromGroup(ElementTextItemGroup *group) const
DynamicElementTextModel::indexFromGroup.
Definition: dynamicelementtextmodel.cpp:933
dynamicelementtextitem.h
DynamicElementTextItemEditor::dataEdited
void dataEdited()
Definition: dynamicelementtextitemeditor.cpp:189
DynamicElementTextModel::indexIsGroup
bool indexIsGroup(const QModelIndex &index) const
DynamicElementTextModel::indexIsGroup.
Definition: dynamicelementtextmodel.cpp:978
DynamicElementTextItemEditor::m_model
DynamicElementTextModel * m_model
Definition: dynamicelementtextitemeditor.h:63
QPropertyUndoCommand
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition: qpropertyundocommand.h:34
deleteqgraphicsitemcommand.h
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
DynamicElementTextModel::dataChanged
void dataChanged()
diagram.h
AbstractElementPropertiesEditorWidget::m_element
QPointer< Element > m_element
Definition: abstractelementpropertieseditorwidget.h:38
DynamicElementTextModel::undoForEditedText
QUndoCommand * undoForEditedText(DynamicElementTextItem *deti, QUndoCommand *parent_undo=nullptr) const
DynamicElementTextModel::undoForEditedText.
Definition: dynamicelementtextmodel.cpp:496
AddElementTextCommand
The AddElementTextCommand class Manage the adding of element text.
Definition: addelementtextcommand.h:34