QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
elementinfowidget.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 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 ELEMENTINFOWIDGET_H
19#define ELEMENTINFOWIDGET_H
20
21#include "../diagramcontext.h"
23
24#include <QWidget>
25
26class Element;
27class QUndoCommand;
30
31namespace Ui {
33}
34
40{
41 Q_OBJECT
42
43 //METHODS
44 public:
45 explicit ElementInfoWidget(Element *elmt, QWidget *parent = nullptr);
46 ~ElementInfoWidget() override;
47
48 void setElement(Element *element) override;
49 void apply() override;
50 QUndoCommand *associatedUndo () const override;
51 QString title() const override {return tr("Informations");}
52 bool setLiveEdit(bool live_edit) override;
53 void updateUi() override;
55
56
57 protected:
58 bool event(QEvent *event) override;
59 void enableLiveEdit() override;
60 void disableLiveEdit() override;
61
62 private:
63 void buildInterface();
64 ElementInfoPartWidget *infoPartWidgetForKey(const QString &key) const;
65
66 private slots:
67 void firstActivated();
68 void elementInfoChange();
69
70 //ATTRIBUTES
71 private:
72 Ui::ElementInfoWidget *ui;
73 QList <ElementInfoPartWidget *> m_eipw_list;
75 bool m_ui_builded = false;
76};
77
78#endif // ELEMENTINFOWIDGET_H
The AbstractElementPropertiesEditorWidget class This class provide common method for all widget used ...
Definition abstractelementpropertieseditorwidget.h:32
The ChangeElementInformationCommand class This class manage undo/redo to change the element informati...
Definition changeelementinformationcommand.h:32
Definition diagramcontext.h:57
Definition element.h:43
The ElementInfoPartWidget class gebruikt bij schema editor als men edit dit Element aanklikt.
Definition elementinfopartwidget.h:33
The ElementInfoWidget class this class is a widget to edit an element informations.
Definition elementinfowidget.h:40
bool setLiveEdit(bool live_edit) override
ElementInfoWidget::setLiveEdit.
Definition elementinfowidget.cpp:121
DiagramContext currentInfo() const
ElementInfoWidget::currentInfo.
Definition elementinfowidget.cpp:244
bool event(QEvent *event) override
ElementInfoWidget::event Reimplemented from QWidget::event Only give focus to the first line edit at ...
Definition elementinfowidget.cpp:142
void disableLiveEdit() override
ElementInfoWidget::disableLiveEdit disable the live edit mode.
Definition elementinfowidget.cpp:169
void firstActivated()
ElementInfoWidget::firstActivated Slot activated when this widget is show. Set the focus to the first...
Definition elementinfowidget.cpp:270
Ui::ElementInfoWidget * ui
Definition elementinfowidget.h:72
QList< ElementInfoPartWidget * > m_eipw_list
Definition elementinfowidget.h:73
QUndoCommand * associatedUndo() const override
ElementInfoWidget::associatedUndo If the edited info is different of the actual element info,...
Definition elementinfowidget.cpp:105
void elementInfoChange()
ElementInfoWidget::elementInfoChange This slot is called when m_element::elementInformation change.
Definition elementinfowidget.cpp:279
void updateUi() override
ElementInfoWidget::updateUi fill information fetch in m_element_info to the corresponding line edit.
Definition elementinfowidget.cpp:220
bool m_ui_builded
Definition elementinfowidget.h:75
QString title() const override
PropertiesEditorWidget::title.
Definition elementinfowidget.h:51
void setElement(Element *element) override
ElementInfoWidget::setElement Set element to be the edited element.
Definition elementinfowidget.cpp:58
void enableLiveEdit() override
ElementInfoWidget::enableLiveEdit Enable the live edit mode.
Definition elementinfowidget.cpp:159
void apply() override
ElementInfoWidget::apply Apply the new information with a new undo command (got with method associate...
Definition elementinfowidget.cpp:92
~ElementInfoWidget() override
ElementInfoWidget::~ElementInfoWidget Destructor.
Definition elementinfowidget.cpp:47
void buildInterface()
ElementInfoWidget::buildInterface Build the widget.
Definition elementinfowidget.cpp:179
bool m_first_activation
Definition elementinfowidget.h:74
ElementInfoPartWidget * infoPartWidgetForKey(const QString &key) const
ElementInfoWidget::infoPartWidgetForKey.
Definition elementinfowidget.cpp:204
Definition autonumberingdockwidget.h:26