QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
elementitemeditor.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 ELEMENT_ITEM_EDITOR_H
19#define ELEMENT_ITEM_EDITOR_H
20
21#include <QWidget>
22
24class ElementScene;
26class QUndoStack;
27
33class ElementItemEditor : public QWidget
34{
35 Q_OBJECT
36 // constructors, destructor
37 public:
38 ElementItemEditor(QETElementEditor *, QWidget * = nullptr);
39 ~ElementItemEditor() override {}
40 private:
42
43 // methods
44 public:
45 virtual QETElementEditor *elementEditor() const;
46 virtual ElementScene *elementScene() const;
47 virtual QUndoStack &undoStack() const;
48
49 virtual QString elementTypeName() const;
50 virtual void setElementTypeName(const QString &);
51 virtual void detach();
52
53 virtual bool setPart(CustomElementPart *) = 0;
54 virtual bool setParts(QList <CustomElementPart *>) {return false;}
55
56 virtual CustomElementPart *currentPart() const = 0;
57 virtual QList<CustomElementPart*> currentParts() const = 0;
58 virtual void updateForm() = 0;
59
60 // attributes
61 private:
64};
65#endif
The CustomElementPart class This abstract class represents a primitive of the visual representation o...
Definition customelementpart.h:40
Definition elementitemeditor.h:34
virtual QString elementTypeName() const
Definition elementitemeditor.cpp:52
virtual void detach()
Definition elementitemeditor.cpp:67
QETElementEditor * element_editor
Definition elementitemeditor.h:62
virtual QUndoStack & undoStack() const
Definition elementitemeditor.cpp:46
virtual CustomElementPart * currentPart() const =0
virtual QList< CustomElementPart * > currentParts() const =0
virtual ElementScene * elementScene() const
Definition elementitemeditor.cpp:40
virtual bool setPart(CustomElementPart *)=0
virtual QETElementEditor * elementEditor() const
Definition elementitemeditor.cpp:34
QString element_type_name
Definition elementitemeditor.h:63
virtual void updateForm()=0
ElementItemEditor(const ElementItemEditor &)
virtual void setElementTypeName(const QString &)
Definition elementitemeditor.cpp:58
~ElementItemEditor() override
Definition elementitemeditor.h:39
virtual bool setParts(QList< CustomElementPart * >)
Definition elementitemeditor.h:54
The ElementScene class This class is the canvas allowing the visual edition of an electrical element....
Definition elementscene.h:46
Definition qetelementeditor.h:39