18#ifndef GENERIC_PANEL_H
19#define GENERIC_PANEL_H
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;
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:56
The GenericPanel class The generic panel is a QTreeWidget subclass providing extra methods allowing d...
Definition genericpanel.h:36
T valueForItem(QTreeWidgetItem *) const
Definition genericpanel.cpp:988
QHash< QETProject *, QTreeWidgetItem * > projects_
projects_ Allow quick retrieval of the item representing a given project
Definition genericpanel.h:213
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:711
bool event(QEvent *) override
GenericPanel::event Handle various events; reimplemented here to emit the signal firstActivated().
Definition genericpanel.cpp:1025
virtual QTreeWidgetItem * addDiagram(Diagram *, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild)
GenericPanel::addDiagram.
Definition genericpanel.cpp:292
virtual QTreeWidgetItem * itemForTemplatesCollection(TitleBlockTemplatesCollection *)
GenericPanel::itemForTemplatesCollection.
Definition genericpanel.cpp:455
virtual QTreeWidgetItem * getItemForProject(QETProject *, bool *=nullptr)
Definition genericpanel.cpp:166
virtual QString defaultText(QET::ItemType)
GenericPanel::defaultText.
Definition genericpanel.cpp:832
virtual QTreeWidgetItem * fillDiagramItem(QTreeWidgetItem *, PanelOptions=AddAllChild, bool=false)
GenericPanel::fillDiagramItem.
Definition genericpanel.cpp:411
QHash< TitleBlockTemplateLocation, QTreeWidgetItem * > tb_templates_
tb_templates_ Allow quick retrieval of the item representing a title block template
Definition genericpanel.h:224
virtual QTreeWidgetItem * addProject(QETProject *, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild)
GenericPanel::addProject.
Definition genericpanel.cpp:133
void unregisterItem(QTreeWidgetItem *)
GenericPanel::unregisterItem.
Definition genericpanel.cpp:1005
virtual QTreeWidgetItem * fillTemplatesCollectionItem(QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions=AddAllChild, bool=false)
GenericPanel::fillTemplatesCollectionItem.
Definition genericpanel.cpp:524
virtual QETProject * projectForItem(QTreeWidgetItem *) const
GenericPanel::projectForItem.
Definition genericpanel.cpp:63
void emitFirstActivated()
GenericPanel::emitFirstActivated Emit the signal firstActivated().
Definition genericpanel.cpp:1040
virtual void projectDiagramsOrderChanged(QETProject *, int, int)
GenericPanel::projectDiagramsOrderChanged.
Definition genericpanel.cpp:756
virtual QTreeWidgetItem * getItemForTemplatesCollection(TitleBlockTemplatesCollection *, bool *=nullptr)
GenericPanel::getItemForTemplatesCollection.
Definition genericpanel.cpp:467
virtual QTreeWidgetItem * fillTemplateItem(QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions=AddAllChild, bool=false)
GenericPanel::fillTemplateItem.
Definition genericpanel.cpp:673
~GenericPanel() override
Definition genericpanel.cpp:44
virtual Diagram * selectedDiagram() const
GenericPanel::selectedDiagram.
Definition genericpanel.cpp:112
virtual QTreeWidgetItem * addTemplatesCollection(TitleBlockTemplatesCollection *, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild)
GenericPanel::addTemplatesCollection.
Definition genericpanel.cpp:426
virtual QTreeWidgetItem * addTemplate(const TitleBlockTemplateLocation &, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild)
GenericPanel::addTemplate.
Definition genericpanel.cpp:577
virtual QTreeWidgetItem * getItemForDiagram(Diagram *, bool *=nullptr)
GenericPanel::getItemForDiagram.
Definition genericpanel.cpp:315
void removeObsoleteItems(const QList< T > &, QTreeWidgetItem *, QET::ItemType, bool)
Definition genericpanel.cpp:969
virtual QTreeWidgetItem * updateProjectItem(QTreeWidgetItem *, QETProject *, PanelOptions=AddAllChild, bool=false)
GenericPanel::updateProjectItem.
Definition genericpanel.cpp:189
virtual void markItemAsUnused(QTreeWidgetItem *)
GenericPanel::markItemAsUnused Mark the provided QTreeWidgetItem as unused in its parent project.
Definition genericpanel.cpp:911
virtual void reparent(QTreeWidgetItem *, QTreeWidgetItem *)
GenericPanel::reparent.
Definition genericpanel.cpp:926
virtual QETProject * selectedProject() const
GenericPanel::selectedProject.
Definition genericpanel.cpp:103
virtual void diagramUsedTemplate(TitleBlockTemplatesCollection *, const QString &)
GenericPanel::diagramUsedTemplate.
Definition genericpanel.cpp:819
virtual void diagramRemoved(QETProject *, Diagram *)
GenericPanel::diagramRemoved.
Definition genericpanel.cpp:744
MetaData
Definition genericpanel.h:50
@ AliasItem
Definition genericpanel.h:52
@ Parent
Definition genericpanel.h:53
@ Item
Definition genericpanel.h:51
@ PanelFlags
Definition genericpanel.h:54
virtual QTreeWidgetItem * updateDiagramItem(QTreeWidgetItem *, Diagram *, PanelOptions=AddAllChild, bool=false)
GenericPanel::updateDiagramItem.
Definition genericpanel.cpp:338
virtual QTreeWidgetItem * fillProjectItem(QTreeWidgetItem *, QETProject *, PanelOptions=AddAllChild, bool=false)
GenericPanel::fillProjectItem.
Definition genericpanel.cpp:237
virtual TitleBlockTemplateLocation templateLocationForItem(QTreeWidgetItem *) const
GenericPanel::templateLocationForItem.
Definition genericpanel.cpp:90
virtual QIcon defaultIcon(QET::ItemType)
GenericPanel::defaultIcon.
Definition genericpanel.cpp:855
virtual void deleteItem(QTreeWidgetItem *, bool=false)
GenericPanel::deleteItem Delete and item and its children.
Definition genericpanel.cpp:894
virtual Diagram * diagramForItem(QTreeWidgetItem *) const
GenericPanel::diagramForItem.
Definition genericpanel.cpp:77
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:692
virtual QTreeWidgetItem * updateTemplateItem(QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions=AddAllChild, bool=false)
GenericPanel::updateTemplateItem.
Definition genericpanel.cpp:630
QList< QTreeWidgetItem * > childItems(QTreeWidgetItem *, QET::ItemType, bool=false) const
GenericPanel::childItems.
Definition genericpanel.cpp:939
virtual void templatesCollectionChanged(TitleBlockTemplatesCollection *, const QString &)
GenericPanel::templatesCollectionChanged.
Definition genericpanel.cpp:806
virtual void diagramAdded(QETProject *, Diagram *)
GenericPanel::diagramAdded.
Definition genericpanel.cpp:733
bool first_activation_
first_activation_ boolean used to track the first time this widget is activated/shown
Definition genericpanel.h:208
virtual QTreeWidgetItem * makeItem(QET::ItemType, QTreeWidgetItem *=nullptr, const QString &=QString(), const QIcon &=QIcon())
GenericPanel::makeItem Create a QTreeWidgetItem.
Definition genericpanel.cpp:877
virtual QTreeWidgetItem * itemForProject(QETProject *)
Definition genericpanel.cpp:153
PanelOption
Definition genericpanel.h:40
@ AddAllChildTemplates
Definition genericpanel.h:44
@ All
Definition genericpanel.h:46
@ AddChildDiagrams
Definition genericpanel.h:41
@ AddChildTemplatesCollection
Definition genericpanel.h:42
@ AddChildTemplates
Definition genericpanel.h:43
@ AddAllChild
Definition genericpanel.h:45
virtual QTreeWidgetItem * getItemForTemplate(const TitleBlockTemplateLocation &, bool *=nullptr)
GenericPanel::getItemForTemplate.
Definition genericpanel.cpp:605
virtual void diagramTitleChanged(Diagram *)
GenericPanel::diagramTitleChanged Inform this panel the diagram diagram has changed its title to titl...
Definition genericpanel.cpp:795
virtual void projectInformationsChanged(QETProject *)
GenericPanel::projectInformationsChanged.
Definition genericpanel.cpp:723
QHash< Diagram *, QTreeWidgetItem * > diagrams_
diagrams_ Allow quick retrieval of the item representing a given diagram
Definition genericpanel.h:218
void panelContentChanged()
virtual QTreeWidgetItem * updateTemplatesCollectionItem(QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions=AddAllChild, bool=false)
GenericPanel::updateTemplatesCollectionItem.
Definition genericpanel.cpp:492
virtual TitleBlockTemplateLocation selectedTemplateLocation() const
GenericPanel::selectedTemplateLocation.
Definition genericpanel.cpp:121
virtual int currentItemType()
Definition genericpanel.cpp:51
Definition qetproject.h:62
Definition templatelocation.h:29
Definition templatescollection.h:35
ItemType
Definition qet.h:95