|
QElectroTech
0.8-dev
|
Go to the documentation of this file.
18 #ifndef GENERIC_PANEL_H
19 #define GENERIC_PANEL_H
21 #include <QTreeWidget>
23 class QTreeWidgetItem;
68 QTreeWidgetItem *)
const;
78 QTreeWidgetItem * =
nullptr,
96 QTreeWidgetItem * =
nullptr,
113 QTreeWidgetItem * =
nullptr,
135 QTreeWidgetItem * =
nullptr,
154 virtual QTreeWidgetItem *
updateItem(QTreeWidgetItem *,
157 virtual QTreeWidgetItem *
fillItem(QTreeWidgetItem *,
178 QTreeWidgetItem * =
nullptr,
179 const QString & = QString(),
180 const QIcon & = QIcon());
181 virtual void deleteItem(QTreeWidgetItem *,
bool =
false);
183 virtual void reparent(QTreeWidgetItem *, QTreeWidgetItem *);
184 QList<QTreeWidgetItem *>
childItems(QTreeWidgetItem *,
190 template<
typename T> T
valueForItem(QTreeWidgetItem *)
const;
193 bool event(QEvent *)
override;
void readOnlyChanged(QETProject *, bool)
@ Project
Definition: qet.h:109
virtual QTreeWidgetItem * getItemForDiagram(Diagram *, bool *=nullptr)
GenericPanel::getItemForDiagram.
Definition: genericpanel.cpp:305
@ Parent
Definition: genericpanel.h:53
@ TitleBlockTemplatesCollection
Definition: qet.h:106
bool event(QEvent *) override
GenericPanel::event Handle various events; reimplemented here to emit the signal firstActivated().
Definition: genericpanel.cpp:1016
virtual void reparent(QTreeWidgetItem *, QTreeWidgetItem *)
GenericPanel::reparent.
Definition: genericpanel.cpp:919
virtual void projectInformationsChanged(QETProject *)
GenericPanel::projectInformationsChanged.
Definition: genericpanel.cpp:714
T valueForItem(QTreeWidgetItem *) const
Definition: genericpanel.cpp:980
virtual QTreeWidgetItem * getItemForTemplate(const TitleBlockTemplateLocation &, bool *=nullptr)
GenericPanel::getItemForTemplate.
Definition: genericpanel.cpp:596
The GenericPanel class The generic panel is a QTreeWidget subclass providing extra methods allowing d...
Definition: genericpanel.h:36
virtual QTreeWidgetItem * updateTemplateItem(QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions=AddAllChild, bool=false)
GenericPanel::updateTemplateItem.
Definition: genericpanel.cpp:621
virtual TitleBlockTemplateLocation templateLocationForItem(QTreeWidgetItem *) const
GenericPanel::templateLocationForItem.
Definition: genericpanel.cpp:84
void projectDiagramsOrderChanged(QETProject *, int, int)
virtual QTreeWidgetItem * fillProjectItem(QTreeWidgetItem *, QETProject *, PanelOptions=AddAllChild, bool=false)
GenericPanel::fillProjectItem.
Definition: genericpanel.cpp:227
void removeObsoleteItems(const QList< T > &, QTreeWidgetItem *, QET::ItemType, bool)
Definition: genericpanel.cpp:961
@ AliasItem
Definition: genericpanel.h:52
~GenericPanel() override
Definition: genericpanel.cpp:42
@ ElementsContainer
Definition: qet.h:103
virtual QTreeWidgetItem * updateDiagramItem(QTreeWidgetItem *, Diagram *, PanelOptions=AddAllChild, bool=false)
GenericPanel::updateDiagramItem.
Definition: genericpanel.cpp:328
void changed(TitleBlockTemplatesCollection *, const QString &=QString())
ItemType
Definition: qet.h:99
void diagramRemoved(QETProject *, Diagram *)
virtual QTreeWidgetItem * getItemForProject(QETProject *, bool *=nullptr)
Definition: genericpanel.cpp:156
virtual void markItemAsUnused(QTreeWidgetItem *)
GenericPanel::markItemAsUnused Mark the provided QTreeWidgetItem as unused in its parent project.
Definition: genericpanel.cpp:904
virtual void diagramAdded(QETProject *, Diagram *)
GenericPanel::diagramAdded.
Definition: genericpanel.cpp:724
virtual QTreeWidgetItem * updateTemplatesCollectionItem(QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions=AddAllChild, bool=false)
GenericPanel::updateTemplatesCollectionItem.
Definition: genericpanel.cpp:483
void emitFirstActivated()
GenericPanel::emitFirstActivated Emit the signal firstActivated().
Definition: genericpanel.cpp:1031
virtual Diagram * diagramForItem(QTreeWidgetItem *) const
GenericPanel::diagramForItem.
Definition: genericpanel.cpp:72
QHash< Diagram *, QTreeWidgetItem * > diagrams_
diagrams_ Allow quick retrieval of the item representing a given diagram
Definition: genericpanel.h:218
virtual QETProject * selectedProject() const
GenericPanel::selectedProject.
Definition: genericpanel.cpp:96
virtual QETProject * projectForItem(QTreeWidgetItem *) const
GenericPanel::projectForItem.
Definition: genericpanel.cpp:59
@ Diagram
Definition: qet.h:108
@ ElementsCollection
Definition: qet.h:102
virtual QTreeWidgetItem * addTemplatesCollection(TitleBlockTemplatesCollection *, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild)
GenericPanel::addTemplatesCollection.
Definition: genericpanel.cpp:417
BorderTitleBlock border_and_titleblock
Diagram dimensions and title block.
Definition: diagram.h:83
virtual void diagramTitleChanged(Diagram *, const QString &)
GenericPanel::diagramTitleChanged Inform this panel the diagram diagram has changed its title to titl...
Definition: genericpanel.cpp:787
@ TitleBlockTemplate
Definition: qet.h:105
virtual QTreeWidgetItem * itemForProject(QETProject *)
Definition: genericpanel.cpp:143
virtual QTreeWidgetItem * updateProjectItem(QTreeWidgetItem *, QETProject *, PanelOptions=AddAllChild, bool=false)
GenericPanel::updateProjectItem.
Definition: genericpanel.cpp:179
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
virtual QTreeWidgetItem * fillItem(QTreeWidgetItem *, PanelOptions=AddAllChild, bool=false)
GenericPanel::fillItem This generic method is called at the end of each fill*Item method....
Definition: genericpanel.cpp:702
MetaData
Definition: genericpanel.h:50
@ Item
Definition: genericpanel.h:51
void diagramUsedTemplate(TitleBlockTemplatesCollection *, const QString &)
void diagramAdded(QETProject *, Diagram *)
QETProject * parentProject() const
Definition: templatelocation.cpp:116
@ All
Definition: genericpanel.h:46
virtual QTreeWidgetItem * itemForTemplatesCollection(TitleBlockTemplatesCollection *)
GenericPanel::itemForTemplatesCollection.
Definition: genericpanel.cpp:446
virtual QTreeWidgetItem * updateItem(QTreeWidgetItem *, PanelOptions=AddAllChild, bool=false)
GenericPanel::updateItem This generic method is called at the end of each update*Item method....
Definition: genericpanel.cpp:683
virtual QTreeWidgetItem * fillDiagramItem(QTreeWidgetItem *, Diagram *, PanelOptions=AddAllChild, bool=false)
GenericPanel::fillDiagramItem.
Definition: genericpanel.cpp:402
virtual QIcon defaultIcon(QET::ItemType)
GenericPanel::defaultIcon.
Definition: genericpanel.cpp:848
bool isValid() const
Definition: templatelocation.cpp:87
Definition: templatelocation.h:29
virtual void diagramUsedTemplate(TitleBlockTemplatesCollection *, const QString &)
GenericPanel::diagramUsedTemplate.
Definition: genericpanel.cpp:812
QString toString() const
Definition: templatelocation.cpp:108
QIcon ProjectFileGP
Definition: qeticons.cpp:148
QIcon Folder
Definition: qeticons.cpp:94
virtual QTreeWidgetItem * fillTemplateItem(QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions=AddAllChild, bool=false)
GenericPanel::fillTemplateItem.
Definition: genericpanel.cpp:664
virtual QTreeWidgetItem * addDiagram(Diagram *, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild)
GenericPanel::addDiagram.
Definition: genericpanel.cpp:282
@ AddChildTemplates
Definition: genericpanel.h:43
@ ElementsCategory
Definition: qet.h:101
virtual void templatesCollectionChanged(TitleBlockTemplatesCollection *, const QString &)
GenericPanel::templatesCollectionChanged.
Definition: genericpanel.cpp:799
virtual TitleBlockTemplateLocation selectedTemplateLocation() const
GenericPanel::selectedTemplateLocation.
Definition: genericpanel.cpp:112
@ AddAllChild
Definition: genericpanel.h:45
void panelContentChanged()
@ AddChildDiagrams
Definition: genericpanel.h:41
The ElementsLocation class This class represents the location, the location of an element or of a cat...
Definition: elementslocation.h:46
virtual QTreeWidgetItem * addProject(QETProject *, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild)
GenericPanel::addProject.
Definition: genericpanel.cpp:123
Definition: qetproject.h:51
void diagramTitleChanged(Diagram *, const QString &)
QString finalfolio() const
Definition: bordertitleblock.h:115
@ AddAllChildTemplates
Definition: genericpanel.h:44
virtual QTreeWidgetItem * fillTemplatesCollectionItem(QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions=AddAllChild, bool=false)
GenericPanel::fillTemplatesCollectionItem.
Definition: genericpanel.cpp:515
virtual Diagram * selectedDiagram() const
GenericPanel::selectedDiagram.
Definition: genericpanel.cpp:104
virtual int currentItemType()
Definition: genericpanel.cpp:48
QList< QTreeWidgetItem * > childItems(QTreeWidgetItem *, QET::ItemType, bool=false) const
GenericPanel::childItems.
Definition: genericpanel.cpp:932
void unregisterItem(QTreeWidgetItem *)
GenericPanel::unregisterItem.
Definition: genericpanel.cpp:996
virtual void diagramRemoved(QETProject *, Diagram *)
GenericPanel::diagramRemoved.
Definition: genericpanel.cpp:735
Definition: templatescollection.h:34
void projectInformationsChanged(QETProject *)
@ TitleBlockTemplatesCollectionItem
Definition: qet.h:107
@ ElementsCollectionItem
Definition: qet.h:104
virtual QTreeWidgetItem * makeItem(QET::ItemType, QTreeWidgetItem *=nullptr, const QString &=QString(), const QIcon &=QIcon())
GenericPanel::makeItem Create a QTreeWidgetItem.
Definition: genericpanel.cpp:870
GenericPanel(QWidget *=nullptr)
Definition: genericpanel.cpp:31
virtual QTreeWidgetItem * getItemForTemplatesCollection(TitleBlockTemplatesCollection *, bool *=nullptr)
GenericPanel::getItemForTemplatesCollection.
Definition: genericpanel.cpp:458
QHash< TitleBlockTemplateLocation, QTreeWidgetItem * > tb_templates_
tb_templates_ Allow quick retrieval of the item representing a title block template
Definition: genericpanel.h:224
bool first_activation_
first_activation_ boolean used to track the first time this widget is activated/shown
Definition: genericpanel.h:208
virtual void projectDiagramsOrderChanged(QETProject *, int, int)
GenericPanel::projectDiagramsOrderChanged.
Definition: genericpanel.cpp:747
virtual QString defaultText(QET::ItemType)
GenericPanel::defaultText.
Definition: genericpanel.cpp:825
@ Element
Definition: qet.h:100
QIcon tr
Definition: qeticons.cpp:206
QIcon TitleBlock
Definition: qeticons.cpp:165
virtual QTreeWidgetItem * addTemplate(const TitleBlockTemplateLocation &, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild)
GenericPanel::addTemplate.
Definition: genericpanel.cpp:568
QHash< QETProject *, QTreeWidgetItem * > projects_
projects_ Allow quick retrieval of the item representing a given project
Definition: genericpanel.h:213
virtual void deleteItem(QTreeWidgetItem *, bool=false)
GenericPanel::deleteItem Delete and item and its children.
Definition: genericpanel.cpp:887
QIcon Diagram
Definition: qeticons.cpp:43
PanelOption
Definition: genericpanel.h:40
QString name() const
Definition: templatelocation.cpp:73
@ AddChildTemplatesCollection
Definition: genericpanel.h:42
virtual TitleBlockTemplateLocation location(const QString &=QString())=0
@ PanelFlags
Definition: genericpanel.h:54