QElectroTech
0.70
sources
ui
elementinfowidget.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 ELEMENTINFOWIDGET_H
19
#define ELEMENTINFOWIDGET_H
20
21
#include <QWidget>
22
#include "
abstractelementpropertieseditorwidget.h
"
23
#include "
diagramcontext.h
"
24
25
class
Element
;
26
class
QUndoCommand;
27
class
ElementInfoPartWidget
;
28
class
ChangeElementInformationCommand
;
29
30
namespace
Ui
{
31
class
ElementInfoWidget
;
32
}
33
38
class
ElementInfoWidget
:
public
AbstractElementPropertiesEditorWidget
39
{
40
Q_OBJECT
41
42
//METHODS
43
public
:
44
explicit
ElementInfoWidget
(
Element
*elmt, QWidget *parent =
nullptr
);
45
~ElementInfoWidget
()
override
;
46
47
void
setElement
(
Element
*element)
override
;
48
void
apply
()
override
;
49
QUndoCommand *
associatedUndo
()
const override
;
50
QString
title
()
const override
{
return
tr
(
"Informations"
);}
51
bool
setLiveEdit
(
bool
live_edit)
override
;
52
void
updateUi
()
override
;
53
DiagramContext
currentInfo
()
const
;
54
55
56
protected
:
57
bool
event
(QEvent *
event
)
override
;
58
void
enableLiveEdit
()
override
;
59
void
disableLiveEdit
()
override
;
60
61
private
:
62
void
buildInterface
();
63
ElementInfoPartWidget
*
infoPartWidgetForKey
(
const
QString &key)
const
;
64
65
private
slots:
66
void
firstActivated
();
67
void
elementInfoChange
();
68
69
//ATTRIBUTES
70
private
:
71
Ui::ElementInfoWidget *
ui
;
72
QList <ElementInfoPartWidget *>
m_eipw_list
;
73
bool
m_first_activation
;
74
};
75
76
#endif // ELEMENTINFOWIDGET_H
ElementInfoWidget::setLiveEdit
bool setLiveEdit(bool live_edit) override
ElementInfoWidget::setLiveEdit.
Definition:
elementinfowidget.cpp:120
ElementInfoWidget::title
QString title() const override
PropertiesEditorWidget::title.
Definition:
elementinfowidget.h:50
ElementInfoWidget::associatedUndo
QUndoCommand * associatedUndo() const override
ElementInfoWidget::associatedUndo If the edited info is different of the actual element info...
Definition:
elementinfowidget.cpp:104
ElementInfoWidget::m_first_activation
bool m_first_activation
Definition:
elementinfowidget.h:73
ElementInfoWidget::currentInfo
DiagramContext currentInfo() const
ElementInfoWidget::currentInfo.
Definition:
elementinfowidget.cpp:230
diagramcontext.h
ElementInfoWidget::firstActivated
void firstActivated()
ElementInfoWidget::firstActivated Slot activated when this widget is show. Set the focus to the first...
Definition:
elementinfowidget.cpp:255
Ui
Definition:
autonumberingdockwidget.h:25
ElementInfoWidget::ui
Ui::ElementInfoWidget * ui
Definition:
elementinfowidget.h:71
DiagramContext
Definition:
diagramcontext.h:53
ElementInfoWidget::updateUi
void updateUi() override
ElementInfoWidget::updateUi fill information fetch in m_element_info to the corresponding line edit...
Definition:
elementinfowidget.cpp:210
ElementInfoWidget::~ElementInfoWidget
~ElementInfoWidget() override
ElementInfoWidget::~ElementInfoWidget Destructor.
Definition:
elementinfowidget.cpp:46
AbstractElementPropertiesEditorWidget
The AbstractElementPropertiesEditorWidget class This class provide common method for all widget used ...
Definition:
abstractelementpropertieseditorwidget.h:30
ElementInfoPartWidget
Definition:
elementinfopartwidget.h:27
ChangeElementInformationCommand
The ChangeElementInformationCommand class This class manage undo/redo to change the element informati...
Definition:
changeelementinformationcommand.h:30
ElementInfoWidget::elementInfoChange
void elementInfoChange()
ElementInfoWidget::elementInfoChange This slot is called when m_element::elementInformation change...
Definition:
elementinfowidget.cpp:263
ElementInfoWidget::disableLiveEdit
void disableLiveEdit() override
ElementInfoWidget::disableLiveEdit disable the live edit mode.
Definition:
elementinfowidget.cpp:168
ElementInfoWidget::m_eipw_list
QList< ElementInfoPartWidget * > m_eipw_list
Definition:
elementinfowidget.h:72
ElementInfoWidget::enableLiveEdit
void enableLiveEdit() override
ElementInfoWidget::enableLiveEdit Enable the live edit mode.
Definition:
elementinfowidget.cpp:158
QET::Icons::tr
QIcon tr
Definition:
qeticons.cpp:204
Element
Definition:
element.h:40
abstractelementpropertieseditorwidget.h
ElementInfoWidget::setElement
void setElement(Element *element) override
ElementInfoWidget::setElement Set to be the edited element.
Definition:
elementinfowidget.cpp:57
ElementInfoWidget::ElementInfoWidget
ElementInfoWidget(Element *elmt, QWidget *parent=nullptr)
ElementInfoWidget::ElementInfoWidget Constructor.
Definition:
elementinfowidget.cpp:32
ElementInfoWidget::apply
void apply() override
ElementInfoWidget::apply Apply the new information with a new undo command (got with method associate...
Definition:
elementinfowidget.cpp:91
ElementInfoWidget::event
bool event(QEvent *event) override
ElementInfoWidget::event Reimplemented from QWidget::event Only give focus to the first line edit at ...
Definition:
elementinfowidget.cpp:141
ElementInfoWidget::buildInterface
void buildInterface()
ElementInfoWidget::buildInterface Build the widget.
Definition:
elementinfowidget.cpp:178
ElementInfoWidget::infoPartWidgetForKey
ElementInfoPartWidget * infoPartWidgetForKey(const QString &key) const
ElementInfoWidget::infoPartWidgetForKey.
Definition:
elementinfowidget.cpp:194
ElementInfoWidget
The ElementInfoWidget class this class is a widget to edit an element informations.
Definition:
elementinfowidget.h:38
Generated by
1.8.15