QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
elementspanel.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2026 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 QList<Diagram *> selectedDiagrams() const;
53
54 signals:
57 // Signal to open the project properties
59 // Signal to open the diagram properties
61
62 public slots:
63 void slot_clicked(QTreeWidgetItem *, int);
64 void slot_doubleClick(QTreeWidgetItem *, int);
65 void reload();
66 void filter(const QString &, QET::Filtering = QET::RegularFilter);
69 void buildFilterList();
70 void applyCurrentFilter(const QList<QTreeWidgetItem *> &);
71 void ensureHierarchyIsVisible(const QList<QTreeWidgetItem *> &);
72 void requestForItem(QTreeWidgetItem *);
73 void keyPressEvent(QKeyEvent *event)override;
74
75 protected:
76 void startDrag(Qt::DropActions) override;
78 bool matchesFilter(const QTreeWidgetItem *, const QString&) const;
79
80 protected slots:
81 void panelContentChange();
82
83 private:
84 QTreeWidgetItem *addProject (QETProject *, QTreeWidgetItem * = nullptr, PanelOptions = AddAllChild) override;
85 QTreeWidgetItem *updateTemplatesCollectionItem(QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions = AddAllChild, bool = false) override;
86 QTreeWidgetItem *updateTemplateItem (QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions, bool = false) override;
87
88 // attributes
89 private:
90 QSet<QETProject *> projects_to_display_;
91 QTreeWidgetItem *common_tbt_collection_item_;
93 QTreeWidgetItem *custom_tbt_collection_item_;
95 QString filter_;
96 QStringList filter_list_;
97};
98#endif
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:54
QTreeWidgetItem * updateTemplatesCollectionItem(QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions=AddAllChild, bool=false) override
GenericPanel::updateTemplatesCollectionItem.
Definition elementspanel.cpp:214
QList< Diagram * > selectedDiagrams() const
ElementsPanel::selectedDiagrams.
Definition elementspanel.cpp:574
void slot_clicked(QTreeWidgetItem *, int)
ElementsPanel::slot_clicked handle click on qtwi.
Definition elementspanel.cpp:316
void filter(const QString &, QET::Filtering=QET::RegularFilter)
Definition elementspanel.cpp:393
void startTitleBlockTemplateDrag(const TitleBlockTemplateLocation &)
Definition elementspanel.cpp:113
~ElementsPanel() override
Definition elementspanel.cpp:91
ElementsPanel(const ElementsPanel &)
QStringList filter_list_
Currently applied list of filter.
Definition elementspanel.h:96
void ensureHierarchyIsVisible(const QList< QTreeWidgetItem * > &)
Definition elementspanel.cpp:489
QString filter_
Currently applied filter.
Definition elementspanel.h:95
bool first_reload_
used to distinguish the first time this panel is reloaded
Definition elementspanel.h:94
bool matchesFilter(const QTreeWidgetItem *, const QString &) const
Definition elementspanel.cpp:253
QTreeWidgetItem * common_tbt_collection_item_
pointer to the item representing the common templates collection
Definition elementspanel.h:91
void projectWasClosed(QETProject *)
Definition elementspanel.cpp:438
void requestForDiagramPropertiesEdition()
QTreeWidgetItem * updateTemplateItem(QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions, bool=false) override
GenericPanel::updateTemplateItem.
Definition elementspanel.cpp:231
void requestForProject(QETProject *)
void keyPressEvent(QKeyEvent *event) override
ElementsPanel::keyPressEvent.
Definition elementspanel.cpp:539
void slot_doubleClick(QTreeWidgetItem *, int)
ElementsPanel::slot_doubleClick handle double click on qtwi.
Definition elementspanel.cpp:329
QTreeWidgetItem * custom_tbt_collection_item_
pointer to the item representing the user templates collection
Definition elementspanel.h:93
void panelContentChange()
Definition elementspanel.cpp:129
QTreeWidgetItem * company_tbt_collection_item_
pointer to the item representing the company's templates collection
Definition elementspanel.h:92
void buildFilterList()
Definition elementspanel.cpp:449
void requestForProjectPropertiesEdition()
void requestForTitleBlockTemplate(const TitleBlockTemplateLocation &)
QString dirPathForItem(QTreeWidgetItem *)
ElementsPanel::dirPathForItem.
Definition elementspanel.cpp:348
void projectWasOpened(QETProject *)
Definition elementspanel.cpp:428
QString filePathForItem(QTreeWidgetItem *)
ElementsPanel::filePathForItem.
Definition elementspanel.cpp:367
QSet< QETProject * > projects_to_display_
list of projects that have been added to this panel
Definition elementspanel.h:90
void requestForItem(QTreeWidgetItem *)
ElementsPanel::syncTabBars set the project- or diagram Tab corresponding to the selection in the tree...
Definition elementspanel.cpp:514
void reload()
ElementsPanel::reload Reload the elements tree.
Definition elementspanel.cpp:272
QTreeWidgetItem * addProject(QETProject *, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild) override
ElementsPanel::addProject Methode permettant d'ajouter un projet au panel d'elements.
Definition elementspanel.cpp:147
void applyCurrentFilter(const QList< QTreeWidgetItem * > &)
Definition elementspanel.cpp:465
ElementsPanel(QWidget *=nullptr)
Definition elementspanel.cpp:41
void startDrag(Qt::DropActions) override
Definition elementspanel.cpp:99
bool event(QEvent *) override
GenericPanel::event Handle various events; reimplemented here to emit the signal firstActivated().
Definition genericpanel.cpp:1046
GenericPanel(QWidget *=nullptr)
Definition genericpanel.cpp:33
@ AddAllChild
Definition genericpanel.h:45
Definition qetproject.h:77
Definition templatelocation.h:29
Definition templatescollection.h:35
Definition templatescollection.h:125
Filtering
Definition qet.h:113
@ RegularFilter
Definition qet.h:115