QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ElementsPanel Class Reference

#include <elementspanel.h>

Inheritance diagram for ElementsPanel:
Inheritance graph
Collaboration diagram for ElementsPanel:
Collaboration graph

Public Slots

void slot_doubleClick (QTreeWidgetItem *, int)
 
void reload ()
 ElementsPanel::reload Reload the elements tree.
 
void filter (const QString &, QET::Filtering=QET::RegularFilter)
 
void projectWasOpened (QETProject *)
 
void projectWasClosed (QETProject *)
 
void buildFilterList ()
 
void applyCurrentFilter (const QList< QTreeWidgetItem * > &)
 
void ensureHierarchyIsVisible (const QList< QTreeWidgetItem * > &)
 

Signals

void requestForProject (QETProject *)
 
void requestForTitleBlockTemplate (const TitleBlockTemplateLocation &)
 
- Signals inherited from GenericPanel
bool firstActivated ()
 
void panelContentChanged ()
 

Public Member Functions

 ElementsPanel (QWidget *=nullptr)
 
 ~ElementsPanel () override
 
QString dirPathForItem (QTreeWidgetItem *)
 ElementsPanel::dirPathForItem.
 
QString filePathForItem (QTreeWidgetItem *)
 ElementsPanel::filePathForItem.
 
- Public Member Functions inherited from GenericPanel
 GenericPanel (QWidget *=nullptr)
 
 ~GenericPanel () override
 
virtual int currentItemType ()
 
virtual QETProjectprojectForItem (QTreeWidgetItem *) const
 GenericPanel::projectForItem.
 
virtual DiagramdiagramForItem (QTreeWidgetItem *) const
 GenericPanel::diagramForItem.
 
virtual TitleBlockTemplateLocation templateLocationForItem (QTreeWidgetItem *) const
 GenericPanel::templateLocationForItem.
 
virtual QETProjectselectedProject () const
 GenericPanel::selectedProject.
 
virtual DiagramselectedDiagram () const
 GenericPanel::selectedDiagram.
 
virtual TitleBlockTemplateLocation selectedTemplateLocation () const
 GenericPanel::selectedTemplateLocation.
 
virtual QTreeWidgetItem * itemForProject (QETProject *)
 
virtual QTreeWidgetItem * addDiagram (Diagram *, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild)
 GenericPanel::addDiagram.
 
virtual QTreeWidgetItem * addTemplatesCollection (TitleBlockTemplatesCollection *, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild)
 GenericPanel::addTemplatesCollection.
 
virtual QTreeWidgetItem * itemForTemplatesCollection (TitleBlockTemplatesCollection *)
 GenericPanel::itemForTemplatesCollection.
 
virtual QTreeWidgetItem * addTemplate (const TitleBlockTemplateLocation &, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild)
 GenericPanel::addTemplate.
 

Protected Slots

void panelContentChange ()
 
- Protected Slots inherited from GenericPanel
virtual void projectInformationsChanged (QETProject *)
 GenericPanel::projectInformationsChanged.
 
virtual void diagramAdded (QETProject *, Diagram *)
 GenericPanel::diagramAdded.
 
virtual void diagramRemoved (QETProject *, Diagram *)
 GenericPanel::diagramRemoved.
 
virtual void projectDiagramsOrderChanged (QETProject *, int, int)
 GenericPanel::projectDiagramsOrderChanged.
 
virtual void diagramTitleChanged (Diagram *)
 GenericPanel::diagramTitleChanged Inform this panel the diagram diagram has changed its title to title.
 
virtual void templatesCollectionChanged (TitleBlockTemplatesCollection *, const QString &)
 GenericPanel::templatesCollectionChanged.
 
virtual void diagramUsedTemplate (TitleBlockTemplatesCollection *, const QString &)
 GenericPanel::diagramUsedTemplate.
 

Protected Member Functions

void startDrag (Qt::DropActions) override
 
void startTitleBlockTemplateDrag (const TitleBlockTemplateLocation &)
 
bool matchesFilter (const QTreeWidgetItem *, const QString &) const
 
- Protected Member Functions inherited from GenericPanel
virtual QTreeWidgetItem * getItemForProject (QETProject *, bool *=nullptr)
 
virtual QTreeWidgetItem * updateProjectItem (QTreeWidgetItem *, QETProject *, PanelOptions=AddAllChild, bool=false)
 GenericPanel::updateProjectItem.
 
virtual QTreeWidgetItem * fillProjectItem (QTreeWidgetItem *, QETProject *, PanelOptions=AddAllChild, bool=false)
 GenericPanel::fillProjectItem.
 
virtual QTreeWidgetItem * getItemForDiagram (Diagram *, bool *=nullptr)
 GenericPanel::getItemForDiagram.
 
virtual QTreeWidgetItem * updateDiagramItem (QTreeWidgetItem *, Diagram *, PanelOptions=AddAllChild, bool=false)
 GenericPanel::updateDiagramItem.
 
virtual QTreeWidgetItem * fillDiagramItem (QTreeWidgetItem *, PanelOptions=AddAllChild, bool=false)
 GenericPanel::fillDiagramItem.
 
virtual QTreeWidgetItem * getItemForTemplatesCollection (TitleBlockTemplatesCollection *, bool *=nullptr)
 GenericPanel::getItemForTemplatesCollection.
 
virtual QTreeWidgetItem * fillTemplatesCollectionItem (QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions=AddAllChild, bool=false)
 GenericPanel::fillTemplatesCollectionItem.
 
virtual QTreeWidgetItem * getItemForTemplate (const TitleBlockTemplateLocation &, bool *=nullptr)
 GenericPanel::getItemForTemplate.
 
virtual QTreeWidgetItem * fillTemplateItem (QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions=AddAllChild, bool=false)
 GenericPanel::fillTemplateItem.
 
virtual QTreeWidgetItem * updateItem (QTreeWidgetItem *, PanelOptions=AddAllChild, bool=false)
 GenericPanel::updateItem This generic method is called at the end of each update*Item method. Its only purpose is being reimplemented in a subclass. The default implementation does nothing.
 
virtual QTreeWidgetItem * fillItem (QTreeWidgetItem *, PanelOptions=AddAllChild, bool=false)
 GenericPanel::fillItem This generic method is called at the end of each fill*Item method. Its only purpose is being reimplemented in a subclass. The default implementation does nothing.
 
virtual QString defaultText (QET::ItemType)
 GenericPanel::defaultText.
 
virtual QIcon defaultIcon (QET::ItemType)
 GenericPanel::defaultIcon.
 
virtual QTreeWidgetItem * makeItem (QET::ItemType, QTreeWidgetItem *=nullptr, const QString &=QString(), const QIcon &=QIcon())
 GenericPanel::makeItem Create a QTreeWidgetItem.
 
virtual void deleteItem (QTreeWidgetItem *, bool=false)
 GenericPanel::deleteItem Delete and item and its children.
 
virtual void markItemAsUnused (QTreeWidgetItem *)
 GenericPanel::markItemAsUnused Mark the provided QTreeWidgetItem as unused in its parent project.
 
virtual void reparent (QTreeWidgetItem *, QTreeWidgetItem *)
 GenericPanel::reparent.
 
QList< QTreeWidgetItem * > childItems (QTreeWidgetItem *, QET::ItemType, bool=false) const
 GenericPanel::childItems.
 
template<typename T >
void removeObsoleteItems (const QList< T > &, QTreeWidgetItem *, QET::ItemType, bool)
 
template<typename T >
valueForItem (QTreeWidgetItem *) const
 
void unregisterItem (QTreeWidgetItem *)
 GenericPanel::unregisterItem.
 
bool event (QEvent *) override
 GenericPanel::event Handle various events; reimplemented here to emit the signal firstActivated().
 

Private Member Functions

 ElementsPanel (const ElementsPanel &)
 
QTreeWidgetItem * addProject (QETProject *, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild) override
 ElementsPanel::addProject Methode permettant d'ajouter un projet au panel d'elements.
 
QTreeWidgetItem * updateTemplatesCollectionItem (QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions=AddAllChild, bool=false) override
 GenericPanel::updateTemplatesCollectionItem.
 
QTreeWidgetItem * updateTemplateItem (QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions, bool=false) override
 GenericPanel::updateTemplateItem.
 

Private Attributes

QSet< QETProject * > projects_to_display_
 list of projects that have been added to this panel
 
QTreeWidgetItem * common_tbt_collection_item_
 pointer to the item representing the common templates collection
 
QTreeWidgetItem * company_tbt_collection_item_
 pointer to the item representing the company's templates collection
 
QTreeWidgetItem * custom_tbt_collection_item_
 pointer to the item representing the user templates collection
 
bool first_reload_
 used to distinguish the first time this panel is reloaded
 
QString filter_
 Currently applied filter.
 
QStringList filter_list_
 Currently applied list of filter.
 

Additional Inherited Members

- Public Types inherited from GenericPanel
enum  PanelOption {
  AddChildDiagrams = 1 , AddChildTemplatesCollection = 2 , AddChildTemplates = 4 , AddAllChildTemplates = 6 ,
  AddAllChild = 63 , All = 127
}
 
enum  MetaData { Item = Qt::UserRole + 1 , AliasItem , Parent , PanelFlags }
 

Detailed Description

This class provides a tree widget listing known filesystem-based elements collections and opened project files along with their content (diagrams, embedded collections, ...). It enables users to perform various actions on the displayed content

Constructor & Destructor Documentation

◆ ElementsPanel() [1/2]

ElementsPanel::ElementsPanel ( QWidget *  parent = nullptr)

Constructeur

Parameters
parentLe QWidget parent du panel d'appareils
Here is the call graph for this function:

◆ ~ElementsPanel()

ElementsPanel::~ElementsPanel ( )
override

Destructeur

◆ ElementsPanel() [2/2]

ElementsPanel::ElementsPanel ( const ElementsPanel )
private

Member Function Documentation

◆ addProject()

QTreeWidgetItem * ElementsPanel::addProject ( QETProject project,
QTreeWidgetItem *  parent_item = nullptr,
PanelOptions  options = AddAllChild 
)
overrideprivatevirtual

ElementsPanel::addProject Methode permettant d'ajouter un projet au panel d'elements.

Parameters
project: project Projet a inserer dans le panel d'elements
parent_item: Q_UNUSED QTreeWidgetItem parent sous lequel sera insere le projet
options: Q_UNUSED
Returns
Le QTreeWidgetItem insere le plus haut

Reimplemented from GenericPanel.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyCurrentFilter

void ElementsPanel::applyCurrentFilter ( const QList< QTreeWidgetItem * > &  items)
slot

Apply the current filter to a given item.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildFilterList

void ElementsPanel::buildFilterList ( )
slot

Build filter list for multiple filter

Here is the caller graph for this function:

◆ dirPathForItem()

QString ElementsPanel::dirPathForItem ( QTreeWidgetItem *  item)

ElementsPanel::dirPathForItem.

Parameters
item: a QTreeWidgetItem
Returns
the directory path of the object represented by item
Here is the call graph for this function:

◆ ensureHierarchyIsVisible

void ElementsPanel::ensureHierarchyIsVisible ( const QList< QTreeWidgetItem * > &  items)
slot
Parameters
itemsune liste de QTreeWidgetItem pour lesquels il faut s'assurer que eux et leurs parents sont visibles
Here is the caller graph for this function:

◆ filePathForItem()

QString ElementsPanel::filePathForItem ( QTreeWidgetItem *  item)

ElementsPanel::filePathForItem.

Parameters
item: a QTreeWidgetItem
Returns
the filepath of the object represented by item
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filter

void ElementsPanel::filter ( const QString &  m,
QET::Filtering  filtering = QET::RegularFilter 
)
slot

Hide items that do not match the provided string, ensure others are visible along with their parent hierarchy. When ending the filtering, restore the tree as it was before the filtering (except the current item) and scroll to the currently selected item.

Parameters
mString to be matched
filteringwhether to begin/apply/end the filtering
See also
QET::Filtering
Here is the call graph for this function:
Here is the caller graph for this function:

◆ matchesFilter()

bool ElementsPanel::matchesFilter ( const QTreeWidgetItem *  item,
const QString &  filter 
) const
protected
Returns
true if item matches the filter, false otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ panelContentChange

void ElementsPanel::panelContentChange ( )
protectedslot

Ensure the filter is applied again after the panel content has changed.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ projectWasClosed

void ElementsPanel::projectWasClosed ( QETProject project)
slot

Enleve un projet du panel d'elements

Parameters
projectProjet a enlever du panel
Here is the call graph for this function:

◆ projectWasOpened

void ElementsPanel::projectWasOpened ( QETProject project)
slot

Rajoute un projet au panel d'elements

Parameters
projectProjet ouvert a rajouter au panel
Here is the call graph for this function:

◆ reload

void ElementsPanel::reload ( )
slot

ElementsPanel::reload Reload the elements tree.

Parameters
reload_collections: true for read all collections since their sources (files, projects ...)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ requestForProject

void ElementsPanel::requestForProject ( QETProject )
signal
Here is the caller graph for this function:

◆ requestForTitleBlockTemplate

void ElementsPanel::requestForTitleBlockTemplate ( const TitleBlockTemplateLocation )
signal
Here is the caller graph for this function:

◆ slot_doubleClick

void ElementsPanel::slot_doubleClick ( QTreeWidgetItem *  qtwi,
int   
)
slot

Gere le double-clic sur un element. Si un double-clic sur un projet est effectue, le signal requestForProject est emis. Si un double-clic sur un schema est effectue, le signal requestForDiagram est emis.

Parameters
qtwi
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startDrag()

void ElementsPanel::startDrag ( Qt::DropActions  supportedActions)
overrideprotected

Gere le debut des drag'n drop

Parameters
supportedActionsLes actions supportees
Here is the call graph for this function:

◆ startTitleBlockTemplateDrag()

void ElementsPanel::startTitleBlockTemplateDrag ( const TitleBlockTemplateLocation location)
protected

Handle the dragging of a title block template

Parameters
locationLocation of the dragged template.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateTemplateItem()

QTreeWidgetItem * ElementsPanel::updateTemplateItem ( QTreeWidgetItem *  tb_template_qtwi,
const TitleBlockTemplateLocation tb_template,
PanelOptions  options,
bool  freshly_created = false 
)
overrideprivatevirtual

GenericPanel::updateTemplateItem.

Parameters
tb_template_qtwi
tb_template
options
freshly_created
Returns
updateItem(tb_template_qtwi, options, freshly_created)

Reimplemented from GenericPanel.

Here is the call graph for this function:

◆ updateTemplatesCollectionItem()

QTreeWidgetItem * ElementsPanel::updateTemplatesCollectionItem ( QTreeWidgetItem *  tbt_collection_qtwi,
TitleBlockTemplatesCollection tbt_collection,
PanelOptions  options = AddAllChild,
bool  freshly_created = false 
)
overrideprivatevirtual

GenericPanel::updateTemplatesCollectionItem.

Parameters
tbt_collection_qtwi
tbt_collection
options
freshly_created
Returns
updateItem(tbt_collection_qtwi, options, freshly_created)

Reimplemented from GenericPanel.

Here is the call graph for this function:

Member Data Documentation

◆ common_tbt_collection_item_

QTreeWidgetItem* ElementsPanel::common_tbt_collection_item_
private

pointer to the item representing the common templates collection

◆ company_tbt_collection_item_

QTreeWidgetItem* ElementsPanel::company_tbt_collection_item_
private

pointer to the item representing the company's templates collection

◆ custom_tbt_collection_item_

QTreeWidgetItem* ElementsPanel::custom_tbt_collection_item_
private

pointer to the item representing the user templates collection

◆ filter_

QString ElementsPanel::filter_
private

Currently applied filter.

◆ filter_list_

QStringList ElementsPanel::filter_list_
private

Currently applied list of filter.

◆ first_reload_

bool ElementsPanel::first_reload_
private

used to distinguish the first time this panel is reloaded

◆ projects_to_display_

QSet<QETProject *> ElementsPanel::projects_to_display_
private

list of projects that have been added to this panel


The documentation for this class was generated from the following files: