QElectroTech  0.8-dev
elementpropertieswidget.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 ELEMENTPROPERTIESWIDGET_H
19 #define ELEMENTPROPERTIESWIDGET_H
20 
22 
23 class Element;
24 class Diagram;
25 class QTabWidget;
26 class ElementsLocation;
29 
30 
32 {
33  Q_OBJECT
34 
35  public:
36  explicit ElementPropertiesWidget(Element *elmt, QWidget *parent = nullptr);
37  explicit ElementPropertiesWidget(DynamicElementTextItem *text, QWidget *parent = nullptr);
38  explicit ElementPropertiesWidget(ElementTextItemGroup *group, QWidget *parent = nullptr);
39  void setElement(Element *element) override;
42  void apply() override;
43  void reset() override;
44  bool setLiveEdit(bool live_edit) override;
45 
46  public slots:
47  void findInPanel ();
48  void editElement ();
49 
50  private:
51  void buildGui();
52  void updateUi() override;
53  void addGeneralWidget();
54  QWidget *generalWidget();
55 
56  signals:
58 
59  private:
61  QTabWidget *m_tab;
62  QList <AbstractElementPropertiesEditorWidget *> m_list_editor;
63  QWidget *m_general_widget;
64 };
65 
66 #endif // ELEMENTPROPERTIESWIDGET_H
Element::Terminale
@ Terminale
Definition: element.h:57
ElementPropertiesWidget::findInPanel
void findInPanel()
ElementPropertiesWidget::findInPanel If m_element is a custom element, emit findElementRequired.
Definition: elementpropertieswidget.cpp:229
DynamicElementTextItemEditor
Definition: dynamicelementtextitemeditor.h:33
ElementPropertiesWidget::addGeneralWidget
void addGeneralWidget()
ElementPropertiesWidget::addGeneralWidget Add or update the general widget on this tab widget.
Definition: elementpropertieswidget.cpp:336
Element::linkType
virtual kind linkType() const
Definition: element.h:159
DynamicElementTextItem
The DynamicElementTextItem class This class provide a simple text field of element who can be added o...
Definition: dynamicelementtextitem.h:39
PropertiesEditorWidget
The PropertiesEditorWidget class This class extend QWidget method for have common way to edit propert...
Definition: propertieseditorwidget.h:31
ElementPropertiesWidget::generalWidget
QWidget * generalWidget()
ElementPropertiesWidget::generalWidget.
Definition: elementpropertieswidget.cpp:353
PropertiesEditorWidget::m_live_edit
bool m_live_edit
Definition: propertieseditorwidget.h:50
dynamicelementtextitemeditor.h
ElementPropertiesWidget::editElement
void editElement()
ElementPropertiesWidget::editElement If m_element is a custom element, emit findElementRequired and e...
Definition: elementpropertieswidget.cpp:242
QetGraphicsItem::diagram
Diagram * diagram() const
Definition: qetgraphicsitem.cpp:40
Element::NextReport
@ NextReport
Definition: element.h:52
linksingleelementwidget.h
masterpropertieswidget.h
diagramposition.h
DynamicElementTextItemEditor::setCurrentGroup
void setCurrentGroup(ElementTextItemGroup *group)
DynamicElementTextItemEditor::setCurrentGroup Expand and select the item for group group.
Definition: dynamicelementtextitemeditor.cpp:159
elementtextitemgroup.h
ElementPropertiesWidget::setElement
void setElement(Element *element) override
ElementPropertiesWidget::setElement Set element to be the edited element.
Definition: elementpropertieswidget.cpp:105
MasterPropertiesWidget
The MasterPropertiesWidget class This class is a widget for make link between a master element with s...
Definition: masterpropertieswidget.h:44
abstractelementpropertieseditorwidget.h
Element::Simple
@ Simple
Definition: element.h:51
Element::Slave
@ Slave
Definition: element.h:56
PropertiesEditorWidget::reset
virtual void reset()
Definition: propertieseditorwidget.h:37
Element::Type
@ Type
Definition: element.h:74
PropertiesEditorWidget::setLiveEdit
virtual bool setLiveEdit(bool live_edit)
PropertiesEditorWidget::setLiveEdit Set the editor in live edit mode. When an editor is in live edit ...
Definition: propertieseditorwidget.cpp:61
ElementPropertiesWidget::findEditClicked
void findEditClicked()
ElementPropertiesWidget::m_general_widget
QWidget * m_general_widget
Definition: elementpropertieswidget.h:63
Diagram
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
qeticons.h
ElementPropertiesWidget::setLiveEdit
bool setLiveEdit(bool live_edit) override
PropertiesEditorWidget::setLiveEdit Set the editor in live edit mode. When an editor is in live edit ...
Definition: elementpropertieswidget.cpp:214
QET::Icons::ElementEdit
QIcon ElementEdit
Definition: qeticons.cpp:85
AbstractElementPropertiesEditorWidget
The AbstractElementPropertiesEditorWidget class This class provide common method for all widget used ...
Definition: abstractelementpropertieseditorwidget.h:31
Diagram::editElementRequired
void editElementRequired(const ElementsLocation &)
Signal emitted when users wish to edit an element from the diagram.
PropertiesEditorWidget::updateUi
virtual void updateUi()
Definition: propertieseditorwidget.h:40
ElementPropertiesWidget::setTextsGroup
void setTextsGroup(ElementTextItemGroup *group)
ElementPropertiesWidget::setTextsGroup Conveniance function : same as call : ElementPropertiesWidget:...
Definition: elementpropertieswidget.cpp:162
ElementPropertiesWidget::setDynamicText
void setDynamicText(DynamicElementTextItem *text)
ElementPropertiesWidget::setDynamicText convenience function: same as call : ElementPropertiesWidget:...
Definition: elementpropertieswidget.cpp:136
Element::Master
@ Master
Definition: element.h:55
element.h
QET::Icons::ZoomDraw
QIcon ZoomDraw
Definition: qeticons.cpp:177
Element
Definition: element.h:41
DynamicElementTextItem::parentElement
Element * parentElement() const
DynamicElementTextItem::ParentElement.
Definition: dynamicelementtextitem.cpp:227
DynamicElementTextItemEditor::setCurrentText
void setCurrentText(DynamicElementTextItem *text)
DynamicElementTextItemEditor::setCurrentText Expand and select the item for text text.
Definition: dynamicelementtextitemeditor.cpp:142
elementpropertieswidget.h
ElementsLocation
The ElementsLocation class This class represents the location, the location of an element or of a cat...
Definition: elementslocation.h:46
Diagram::findElementRequired
void findElementRequired(const ElementsLocation &)
ElementPropertiesWidget::apply
void apply() override
ElementPropertiesWidget::apply Apply the new properties by pushing an undo command to the parent proj...
Definition: elementpropertieswidget.cpp:184
elementinfowidget.h
ElementPropertiesWidget
Definition: elementpropertieswidget.h:32
ElementTextItemGroup
The ElementTextItemGroup class This class represent a group of element text Texts in the group can be...
Definition: elementtextitemgroup.h:36
ElementPropertiesWidget::updateUi
void updateUi() override
ElementPropertiesWidget::updateUi Update the content of this widget.
Definition: elementpropertieswidget.cpp:268
ElementPropertiesWidget::reset
void reset() override
ElementPropertiesWidget::reset Reset the edited properties.
Definition: elementpropertieswidget.cpp:210
dynamicelementtextitem.h
ElementPropertiesWidget::m_tab
QTabWidget * m_tab
Definition: elementpropertieswidget.h:61
ElementPropertiesWidget::m_list_editor
QList< AbstractElementPropertiesEditorWidget * > m_list_editor
Definition: elementpropertieswidget.h:62
AbstractElementPropertiesEditorWidget::setElement
virtual void setElement(Element *element)=0
ElementPropertiesWidget::m_diagram
Diagram * m_diagram
Definition: elementpropertieswidget.h:60
ElementPropertiesWidget::ElementPropertiesWidget
ElementPropertiesWidget(Element *elmt, QWidget *parent=nullptr)
ElementPropertiesWidget::ElementPropertiesWidget Default constructor.
Definition: elementpropertieswidget.cpp:40
ElementInfoWidget
The ElementInfoWidget class this class is a widget to edit an element informations.
Definition: elementinfowidget.h:39
PropertiesEditorWidget::associatedUndo
virtual QUndoCommand * associatedUndo() const
PropertiesEditorWidget::associatedUndo By default, return a nullptr.
Definition: propertieseditorwidget.cpp:36
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
Element::PreviousReport
@ PreviousReport
Definition: element.h:53
diagram.h
ElementPropertiesWidget::buildGui
void buildGui()
ElementPropertiesWidget::build Build the content of this widget.
Definition: elementpropertieswidget.cpp:256
AbstractElementPropertiesEditorWidget::m_element
QPointer< Element > m_element
Definition: abstractelementpropertieseditorwidget.h:38