QElectroTech  0.70
dynamicelementtextitemeditor.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 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:
37  explicit DynamicElementTextItemEditor(Element *element, QWidget *parent = nullptr);
39 
40  void setElement(Element *element) override;
41  QString title() const override {return tr("Textes");}
42  bool setLiveEdit(bool live_edit) override;
43  void apply() override;
46  QUndoCommand *associatedUndo() const override;
47 
48  private:
49  void dataEdited();
50 
51  private slots:
52  void on_m_add_text_clicked();
55  void on_m_tree_view_clicked(const QModelIndex &index);
58 
59  private:
60  Ui::DynamicElementTextItemEditor *ui;
62 };
63 
64 #endif // DYNAMICELEMENTTEXTITEMEDITOR_H
The DynamicElementTextItem class This class provide a simple text field of element who can be added o...
QUndoCommand * associatedUndo() const override
PropertiesEditorWidget::associatedUndo By default, return a nullptr.
bool setLiveEdit(bool live_edit) override
PropertiesEditorWidget::setLiveEdit Set the editor in live edit mode. When an editor is in live edit ...
void setElement(Element *element) override
Ui::DynamicElementTextItemEditor * ui
void on_m_remove_selection_clicked()
DynamicElementTextItemEditor::on_m_remove_selection_clicked Remove the selected item.
void on_m_add_text_clicked()
DynamicElementTextItemEditor::on_m_add_text_clicked Add a new dynamic text.
void on_m_add_group_clicked()
DynamicElementTextItemEditor::on_m_add_group_clicked Add a new group.
The AbstractElementPropertiesEditorWidget class This class provide common method for all widget used ...
void setCurrentGroup(ElementTextItemGroup *group)
DynamicElementTextItemEditor::setCurrentGroup Expand and select the item for group ...
void on_m_tree_view_clicked(const QModelIndex &index)
QIcon tr
Definition: qeticons.cpp:204
DynamicElementTextItemEditor(Element *element, QWidget *parent=nullptr)
The ElementTextItemGroup class This class represent a group of element text Texts in the group can be...
void setCurrentText(DynamicElementTextItem *text)
DynamicElementTextItemEditor::setCurrentText Expand and select the item for text .
QString title() const override
PropertiesEditorWidget::title.
The DynamicElementTextModel class A model to use with QtView. This model display and can edit the val...