QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
elementcollectionitem.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 ELEMENTCOLLECTIONITEM2_H
19#define ELEMENTCOLLECTIONITEM2_H
20
21#include <QStandardItem>
22
29class ElementCollectionItem : public QStandardItem
30{
31 public:
33
34 enum {Type = UserType+1};
35 int type() const override { return Type; }
36
37 virtual bool isDir() const = 0;
38 virtual bool isElement() const = 0;
39 virtual QString localName() = 0;
40 virtual QString name() const = 0;
41 virtual QString collectionPath() const = 0;
42 virtual bool isCollectionRoot() const = 0;
43 virtual void addChildAtPath(const QString &collection_name) = 0;
44 virtual void setUpData() = 0;
45 virtual void setUpIcon() = 0;
46 virtual void clearData();
47
48 ElementCollectionItem *lastItemForPath(const QString &path, QString &no_found_path);
50 QList<QStandardItem *> directChilds() const;
51 int rowForInsertItem(const QString &name);
52 ElementCollectionItem *itemAtPath(const QString &path);
53
54 QList<ElementCollectionItem *> elementsDirectChild() const;
55 QList<ElementCollectionItem *> directoriesDirectChild() const;
56 QList<ElementCollectionItem *> elementsChild() const;
57 QList<ElementCollectionItem *> directoriesChild() const;
58 QList<ElementCollectionItem *> items() const;
59};
60
62
63#endif // ELEMENTCOLLECTIONITEM2_H
The ElementCollectionItem class This class represent a item (a directory or an element) in a element ...
Definition elementcollectionitem.h:30
QList< ElementCollectionItem * > directoriesDirectChild() const
ElementCollectionItem::directoriesDirectChild.
Definition elementcollectionitem.cpp:190
virtual QString name() const =0
ElementCollectionItem()
ElementCollectionItem::ElementCollectionItem Constructor.
Definition elementcollectionitem.cpp:25
ElementCollectionItem * itemAtPath(const QString &path)
ElementCollectionItem::itemAtPath.
Definition elementcollectionitem.cpp:151
virtual void addChildAtPath(const QString &collection_name)=0
virtual bool isCollectionRoot() const =0
virtual QString collectionPath() const =0
int rowForInsertItem(const QString &name)
ElementCollectionItem::rowForInsertItem Return the row for insert a new child item to this item with ...
Definition elementcollectionitem.cpp:116
@ Type
Definition elementcollectionitem.h:34
QList< ElementCollectionItem * > elementsChild() const
ElementCollectionItem::elementsChild.
Definition elementcollectionitem.cpp:207
virtual void clearData()
ElementCollectionItem::clearData Reset the data.
Definition elementcollectionitem.cpp:32
virtual void setUpIcon()=0
ElementCollectionItem * childWithCollectionName(const QString &name) const
ElementCollectionItem::childWithCollectionName Return the child with the collection name name,...
Definition elementcollectionitem.cpp:81
virtual QString localName()=0
QList< ElementCollectionItem * > items() const
ElementCollectionItem::items.
Definition elementcollectionitem.cpp:237
int type() const override
Definition elementcollectionitem.h:35
virtual bool isElement() const =0
virtual bool isDir() const =0
QList< QStandardItem * > directChilds() const
ElementCollectionItem::directChilds Return the direct child of this item.
Definition elementcollectionitem.cpp:99
QList< ElementCollectionItem * > directoriesChild() const
ElementCollectionItem::directoriesChild.
Definition elementcollectionitem.cpp:221
QList< ElementCollectionItem * > elementsDirectChild() const
ElementCollectionItem::elementsDirectChild.
Definition elementcollectionitem.cpp:173
ElementCollectionItem * lastItemForPath(const QString &path, QString &no_found_path)
ElementCollectionItem::lastItemForPath Return the last existing item in this ElementCollectionItem hi...
Definition elementcollectionitem.cpp:52
virtual void setUpData()=0
void setUpData(ElementCollectionItem *eci)
Definition elementcollectionitem.cpp:250