QElectroTech  0.70
elementpropertieswidget.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 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:
57  void findEditClicked();
58 
59  private:
61  QTabWidget *m_tab;
62  QList <AbstractElementPropertiesEditorWidget *> m_list_editor;
63  QWidget *m_general_widget;
64 };
65 
66 #endif // ELEMENTPROPERTIESWIDGET_H
ElementPropertiesWidget(Element *elmt, QWidget *parent=nullptr)
ElementPropertiesWidget::ElementPropertiesWidget Default constructor.
void setDynamicText(DynamicElementTextItem *text)
ElementPropertiesWidget::setDynamicText convenience function: same as call : ElementPropertiesWidget:...
The DynamicElementTextItem class This class provide a simple text field of element who can be added o...
void editElement()
ElementPropertiesWidget::editElement If m_element is a custom element, emit findElementRequired and e...
QWidget * generalWidget()
ElementPropertiesWidget::generalWidget.
bool setLiveEdit(bool live_edit) override
PropertiesEditorWidget::setLiveEdit Set the editor in live edit mode. When an editor is in live edit ...
void addGeneralWidget()
ElementPropertiesWidget::addGeneralWidget Add or update the general widget on this tab widget...
QList< AbstractElementPropertiesEditorWidget * > m_list_editor
void setTextsGroup(ElementTextItemGroup *group)
ElementPropertiesWidget::setTextsGroup Conveniance function : same as call : ElementPropertiesWidget:...
The AbstractElementPropertiesEditorWidget class This class provide common method for all widget used ...
void findInPanel()
ElementPropertiesWidget::findInPanel If m_element is a custom element, emit findElementRequired.
void buildGui()
ElementPropertiesWidget::build Build the content of this widget.
The ElementTextItemGroup class This class represent a group of element text Texts in the group can be...
void updateUi() override
ElementPropertiesWidget::updateUi Update the content of this widget.
void reset() override
ElementPropertiesWidget::reset Reset the edited properties.
void apply() override
ElementPropertiesWidget::apply Apply the new properties by pushing an undo command to the parent proj...
void setElement(Element *element) override
ElementPropertiesWidget::setElement Set to be the edited element.