QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
elementprovider.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 ELEMENTPROVIDER_H
19#define ELEMENTPROVIDER_H
20
21#include <QUuid>
22#include <QList>
23#include <QAbstractTableModel>
24
26
27class QETProject;
28class Diagram;
29class Element;
31class TerminalElement;
32
40{
41 public:
42 ElementProvider(QETProject *prj, Diagram *diagram=nullptr);
44 QVector <QPointer<Element>> freeElement(ElementData::Types filter) const;
45 QList <Element *> fromUuids(QList <QUuid>) const;
46 QVector<QPointer<Element> > find(ElementData::Types elmt_type) const;
47 QVector <QetGraphicsTableItem *> table(QetGraphicsTableItem *table = nullptr, QAbstractItemModel *model = nullptr);
48 QetGraphicsTableItem *tableFromUuid(const QUuid &uuid);
49 QVector<TerminalElement *> freeTerminal() const;
50
51 private:
52 QList <Diagram *> m_diagram_list;
53};
54
55#endif // ELEMENTPROVIDER_H
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:56
Definition element.h:43
Definition elementprovider.h:40
QVector< TerminalElement * > freeTerminal() const
ElementProvider::freeTerminal.
Definition elementprovider.cpp:197
QVector< QetGraphicsTableItem * > table(QetGraphicsTableItem *table=nullptr, QAbstractItemModel *model=nullptr)
ElementProvider::table.
Definition elementprovider.cpp:131
QVector< QPointer< Element > > freeElement(ElementData::Types filter) const
ElementProvider::FreeElement Search and return the asked element corresponding with the given filter ...
Definition elementprovider.cpp:56
QVector< QPointer< Element > > find(ElementData::Types elmt_type) const
ElementProvider::find Search and return the element with the type given in parameter.
Definition elementprovider.cpp:106
QList< Diagram * > m_diagram_list
Definition elementprovider.h:52
QList< Element * > fromUuids(QList< QUuid >) const
ElementProvider::fromUuids.
Definition elementprovider.cpp:85
QetGraphicsTableItem * tableFromUuid(const QUuid &uuid)
ElementProvider::tableFromUuid.
Definition elementprovider.cpp:183
Definition qetproject.h:62
The QetGraphicsTableItem class This item display a table destined to represent the content of a QAbst...
Definition qetgraphicstableitem.h:43
The TerminalElement class.
Definition terminalelement.h:31