QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
elementspanel.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 PANELAPPAREILS_H
19#define PANELAPPAREILS_H
20
21#include "genericpanel.h"
23
24class QETProject;
25class Diagram;
27
35 Q_OBJECT
36
37 // constructors, destructor
38 public:
39 ElementsPanel(QWidget * = nullptr);
40 ~ElementsPanel() override;
41
42 private:
44
45 // methods
46 public:
47 // methods used to determine what is represented by a particular visual item
48
49 // methods used to get what is represented by a particular visual item
50 QString dirPathForItem(QTreeWidgetItem *);
51 QString filePathForItem(QTreeWidgetItem *);
52
53 signals:
56
57 public slots:
58 void slot_doubleClick(QTreeWidgetItem *, int);
59 void reload();
60 void filter(const QString &, QET::Filtering = QET::RegularFilter);
63 void buildFilterList();
64 void applyCurrentFilter(const QList<QTreeWidgetItem *> &);
65 void ensureHierarchyIsVisible(const QList<QTreeWidgetItem *> &);
66
67 protected:
68 void startDrag(Qt::DropActions) override;
70 bool matchesFilter(const QTreeWidgetItem *, const QString&) const;
71
72 protected slots:
73 void panelContentChange();
74
75 private:
76 QTreeWidgetItem *addProject (QETProject *, QTreeWidgetItem * = nullptr, PanelOptions = AddAllChild) override;
77 QTreeWidgetItem *updateTemplatesCollectionItem(QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions = AddAllChild, bool = false) override;
78 QTreeWidgetItem *updateTemplateItem (QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions, bool = false) override;
79
80 // attributes
81 private:
82 QSet<QETProject *> projects_to_display_;
83 QTreeWidgetItem *common_tbt_collection_item_;
85 QTreeWidgetItem *custom_tbt_collection_item_;
87 QString filter_;
88 QStringList filter_list_;
89};
90#endif
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:56
Definition elementspanel.h:34
QTreeWidgetItem * updateTemplatesCollectionItem(QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions=AddAllChild, bool=false) override
GenericPanel::updateTemplatesCollectionItem.
Definition elementspanel.cpp:163
void filter(const QString &, QET::Filtering=QET::RegularFilter)
Definition elementspanel.cpp:332
void startTitleBlockTemplateDrag(const TitleBlockTemplateLocation &)
Definition elementspanel.cpp:100
~ElementsPanel() override
Definition elementspanel.cpp:78
ElementsPanel(const ElementsPanel &)
QStringList filter_list_
Currently applied list of filter.
Definition elementspanel.h:88
void ensureHierarchyIsVisible(const QList< QTreeWidgetItem * > &)
Definition elementspanel.cpp:428
QString filter_
Currently applied filter.
Definition elementspanel.h:87
bool first_reload_
used to distinguish the first time this panel is reloaded
Definition elementspanel.h:86
bool matchesFilter(const QTreeWidgetItem *, const QString &) const
Definition elementspanel.cpp:202
QTreeWidgetItem * common_tbt_collection_item_
pointer to the item representing the common templates collection
Definition elementspanel.h:83
void projectWasClosed(QETProject *)
Definition elementspanel.cpp:377
QTreeWidgetItem * updateTemplateItem(QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions, bool=false) override
GenericPanel::updateTemplateItem.
Definition elementspanel.cpp:180
void requestForProject(QETProject *)
void slot_doubleClick(QTreeWidgetItem *, int)
Definition elementspanel.cpp:268
QTreeWidgetItem * custom_tbt_collection_item_
pointer to the item representing the user templates collection
Definition elementspanel.h:85
void panelContentChange()
Definition elementspanel.cpp:116
QTreeWidgetItem * company_tbt_collection_item_
pointer to the item representing the company's templates collection
Definition elementspanel.h:84
void buildFilterList()
Definition elementspanel.cpp:388
void requestForTitleBlockTemplate(const TitleBlockTemplateLocation &)
QString dirPathForItem(QTreeWidgetItem *)
ElementsPanel::dirPathForItem.
Definition elementspanel.cpp:287
void projectWasOpened(QETProject *)
Definition elementspanel.cpp:367
QString filePathForItem(QTreeWidgetItem *)
ElementsPanel::filePathForItem.
Definition elementspanel.cpp:306
QSet< QETProject * > projects_to_display_
list of projects that have been added to this panel
Definition elementspanel.h:82
void reload()
ElementsPanel::reload Reload the elements tree.
Definition elementspanel.cpp:221
QTreeWidgetItem * addProject(QETProject *, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild) override
ElementsPanel::addProject Methode permettant d'ajouter un projet au panel d'elements.
Definition elementspanel.cpp:134
void applyCurrentFilter(const QList< QTreeWidgetItem * > &)
Definition elementspanel.cpp:404
void startDrag(Qt::DropActions) override
Definition elementspanel.cpp:86
The GenericPanel class The generic panel is a QTreeWidget subclass providing extra methods allowing d...
Definition genericpanel.h:36
@ AddAllChild
Definition genericpanel.h:45
Definition qetproject.h:62
Definition templatelocation.h:29
Definition templatescollection.h:35
Definition templatescollection.h:125
Filtering
Definition qet.h:112
@ RegularFilter
Definition qet.h:114