QElectroTech
0.70
|
#include <elementspanel.h>
Public Slots | |
void | slot_doubleClick (QTreeWidgetItem *, int) |
void | reload (bool=false) |
ElementsPanel::reload Reload the elements tree. More... | |
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 | requestForDiagram (Diagram *) |
void | requestForTitleBlockTemplate (const TitleBlockTemplateLocation &) |
![]() | |
bool | firstActivated () |
void | panelContentChanged () |
Public Member Functions | |
ElementsPanel (QWidget *=nullptr) | |
~ElementsPanel () override | |
QString | dirPathForItem (QTreeWidgetItem *) |
QString | filePathForItem (QTreeWidgetItem *) |
![]() | |
GenericPanel (QWidget *=nullptr) | |
~GenericPanel () override | |
virtual int | currentItemType () |
virtual QETProject * | projectForItem (QTreeWidgetItem *) const |
virtual Diagram * | diagramForItem (QTreeWidgetItem *) const |
virtual TitleBlockTemplateLocation | templateLocationForItem (QTreeWidgetItem *) const |
virtual QETProject * | selectedProject () const |
virtual Diagram * | selectedDiagram () const |
virtual TitleBlockTemplateLocation | selectedTemplateLocation () const |
virtual QTreeWidgetItem * | itemForProject (QETProject *) |
virtual QTreeWidgetItem * | addDiagram (Diagram *, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild) |
virtual QTreeWidgetItem * | addTemplatesCollection (TitleBlockTemplatesCollection *, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild) |
virtual QTreeWidgetItem * | itemForTemplatesCollection (TitleBlockTemplatesCollection *) |
virtual QTreeWidgetItem * | addTemplate (const TitleBlockTemplateLocation &, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild) |
Protected Slots | |
void | panelContentChange () |
![]() | |
virtual void | projectInformationsChanged (QETProject *) |
virtual void | diagramAdded (QETProject *, Diagram *) |
virtual void | diagramRemoved (QETProject *, Diagram *) |
virtual void | projectDiagramsOrderChanged (QETProject *, int, int) |
GenericPanel::projectDiagramsOrderChanged. More... | |
virtual void | diagramTitleChanged (Diagram *, const QString &) |
virtual void | templatesCollectionChanged (TitleBlockTemplatesCollection *, const QString &) |
virtual void | diagramUsedTemplate (TitleBlockTemplatesCollection *, const QString &) |
Protected Member Functions | |
void | startDrag (Qt::DropActions) override |
void | startTitleBlockTemplateDrag (const TitleBlockTemplateLocation &) |
bool | matchesFilter (const QTreeWidgetItem *, const QString &) const |
![]() | |
virtual QTreeWidgetItem * | getItemForProject (QETProject *, bool *=nullptr) |
virtual QTreeWidgetItem * | updateProjectItem (QTreeWidgetItem *, QETProject *, PanelOptions=AddAllChild, bool=false) |
virtual QTreeWidgetItem * | fillProjectItem (QTreeWidgetItem *, QETProject *, PanelOptions=AddAllChild, bool=false) |
virtual QTreeWidgetItem * | getItemForDiagram (Diagram *, bool *=nullptr) |
virtual QTreeWidgetItem * | updateDiagramItem (QTreeWidgetItem *, Diagram *, PanelOptions=AddAllChild, bool=false) |
virtual QTreeWidgetItem * | fillDiagramItem (QTreeWidgetItem *, Diagram *, PanelOptions=AddAllChild, bool=false) |
virtual QTreeWidgetItem * | getItemForTemplatesCollection (TitleBlockTemplatesCollection *, bool *=nullptr) |
virtual QTreeWidgetItem * | fillTemplatesCollectionItem (QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions=AddAllChild, bool=false) |
virtual QTreeWidgetItem * | getItemForTemplate (const TitleBlockTemplateLocation &, bool *=nullptr) |
virtual QTreeWidgetItem * | fillTemplateItem (QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions=AddAllChild, bool=false) |
virtual QTreeWidgetItem * | updateItem (QTreeWidgetItem *, PanelOptions=AddAllChild, bool=false) |
virtual QTreeWidgetItem * | fillItem (QTreeWidgetItem *, PanelOptions=AddAllChild, bool=false) |
virtual QString | defaultText (QET::ItemType) |
virtual QIcon | defaultIcon (QET::ItemType) |
virtual QTreeWidgetItem * | makeItem (QET::ItemType, QTreeWidgetItem *=nullptr, const QString &=QString(), const QIcon &=QIcon()) |
virtual void | deleteItem (QTreeWidgetItem *, bool=false) |
virtual void | markItemAsUnused (QTreeWidgetItem *) |
virtual void | reparent (QTreeWidgetItem *, QTreeWidgetItem *) |
QList< QTreeWidgetItem * > | childItems (QTreeWidgetItem *, QET::ItemType, bool=false) const |
template<typename T > | |
void | removeObsoleteItems (const QList< T > &, QTreeWidgetItem *, QET::ItemType, bool) |
template<typename T > | |
T | valueForItem (QTreeWidgetItem *) const |
void | unregisterItem (QTreeWidgetItem *) |
bool | event (QEvent *) override |
Private Member Functions | |
ElementsPanel (const ElementsPanel &) | |
QTreeWidgetItem * | addProject (QETProject *, QTreeWidgetItem *=nullptr, PanelOptions=AddAllChild) override |
QTreeWidgetItem * | updateTemplatesCollectionItem (QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions=AddAllChild, bool=false) override |
QTreeWidgetItem * | updateTemplateItem (QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions, bool=false) override |
Private Attributes | |
QSet< QETProject * > | projects_to_display_ |
list of projects that have been added to this panel More... | |
QTreeWidgetItem * | common_tbt_collection_item_ |
pointer to the item representing the common templates collection More... | |
QTreeWidgetItem * | custom_tbt_collection_item_ |
pointer to the item representing the user templates collection More... | |
bool | first_reload_ |
used to distinguish the first time this panel is reloaded More... | |
QString | filter_ |
Currently applied filter. More... | |
QStringList | filter_list_ |
Currently applied list of filter. More... | |
Additional Inherited Members | |
![]() | |
enum | PanelOption { AddChildDiagrams = 1, AddChildTemplatesCollection = 2, AddChildTemplates = 4, AddAllChildTemplates = 6, AddAllChild = 63, All = 127 } |
enum | MetaData { Item = Qt::UserRole + 1, AliasItem, Parent, PanelFlags } |
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
Definition at line 34 of file elementspanel.h.
ElementsPanel::ElementsPanel | ( | QWidget * | parent = nullptr | ) |
Constructeur
parent | Le QWidget parent du panel d'appareils |
Definition at line 39 of file elementspanel.cpp.
References GenericPanel::firstActivated(), panelContentChange(), GenericPanel::panelContentChanged(), reload(), and slot_doubleClick().
|
override |
Destructeur
Definition at line 77 of file elementspanel.cpp.
|
private |
|
overrideprivatevirtual |
Methode permettant d'ajouter un projet au panel d'elements.
qtwi_parent | QTreeWidgetItem parent sous lequel sera insere le projet |
project | Projet a inserer dans le panel d'elements |
Reimplemented from GenericPanel.
Definition at line 126 of file elementspanel.cpp.
References GenericPanel::addProject(), GenericPanel::All, common_tbt_collection_item_, first_reload_, GenericPanel::itemForTemplatesCollection(), projects_to_display_, and QET::Icons::tr.
Referenced by projectWasOpened(), and reload().
|
slot |
Apply the current filter to a given item.
Definition at line 365 of file elementspanel.cpp.
References buildFilterList(), ensureHierarchyIsVisible(), filter(), filter_, filter_list_, and matchesFilter().
Referenced by filter().
|
slot |
Build filter list for multiple filter
Definition at line 350 of file elementspanel.cpp.
References filter_, and filter_list_.
Referenced by applyCurrentFilter().
QString ElementsPanel::dirPathForItem | ( | QTreeWidgetItem * | item | ) |
qtwi | a QTreeWidgetItem |
Definition at line 250 of file elementspanel.cpp.
References filePathForItem().
|
slot |
items | une liste de QTreeWidgetItem pour lesquels il faut s'assurer que eux et leurs parents sont visibles |
Definition at line 389 of file elementspanel.cpp.
Referenced by applyCurrentFilter(), and filter().
QString ElementsPanel::filePathForItem | ( | QTreeWidgetItem * | item | ) |
qtwi | a QTreeWidgetItem |
Definition at line 268 of file elementspanel.cpp.
References TitleBlockTemplateLocation::parentCollection(), GenericPanel::projectForItem(), and GenericPanel::templateLocationForItem().
Referenced by dirPathForItem().
|
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.
m | String to be matched |
filtering | whether to begin/apply/end the filtering |
Definition at line 294 of file elementspanel.cpp.
References applyCurrentFilter(), QET::BeginFilter, QET::EndFilter, ensureHierarchyIsVisible(), and filter_.
Referenced by applyCurrentFilter(), matchesFilter(), and panelContentChange().
|
protected |
Definition at line 177 of file elementspanel.cpp.
References filter().
Referenced by applyCurrentFilter().
|
protectedslot |
Ensure the filter is applied again after the panel content has changed.
Definition at line 114 of file elementspanel.cpp.
References filter(), and filter_.
Referenced by ElementsPanel().
|
slot |
Enleve un projet du panel d'elements
project | Projet a enlever du panel |
Definition at line 339 of file elementspanel.cpp.
References GenericPanel::deleteItem(), GenericPanel::itemForProject(), GenericPanel::panelContentChanged(), and projects_to_display_.
|
slot |
Rajoute un projet au panel d'elements
project | Projet ouvert a rajouter au panel |
Definition at line 329 of file elementspanel.cpp.
References addProject(), GenericPanel::panelContentChanged(), and projects_to_display_.
|
slot |
ElementsPanel::reload Reload the elements tree.
reload_collections | true for read all collections since their sources (files, projects ...) |
Definition at line 193 of file elementspanel.cpp.
References addProject(), GenericPanel::addTemplatesCollection(), common_tbt_collection_item_, QETApp::commonTitleBlockTemplatesCollection(), custom_tbt_collection_item_, QETApp::customTitleBlockTemplatesCollection(), first_reload_, projects_to_display_, and QET::Icons::tr.
Referenced by ElementsPanel().
|
signal |
Referenced by slot_doubleClick().
|
signal |
Referenced by slot_doubleClick().
|
signal |
Referenced by slot_doubleClick().
|
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.
qtwi |
Definition at line 232 of file elementspanel.cpp.
References QET::Diagram, QET::Project, requestForDiagram(), requestForProject(), requestForTitleBlockTemplate(), and QET::TitleBlockTemplate.
Referenced by ElementsPanel().
|
overrideprotected |
Gere le debut des drag'n drop
supportedActions | Les actions supportees |
Definition at line 84 of file elementspanel.cpp.
References TitleBlockTemplateLocation::isValid(), GenericPanel::selectedTemplateLocation(), and startTitleBlockTemplateDrag().
|
protected |
Handle the dragging of a title block template
location | Location of the dragged template. |
Definition at line 98 of file elementspanel.cpp.
References QET::Icons::TitleBlock, and TitleBlockTemplateLocation::toString().
Referenced by startDrag().
|
overrideprivatevirtual |
Reimplemented from GenericPanel.
Definition at line 162 of file elementspanel.cpp.
References QET::Icons::tr, and GenericPanel::updateTemplateItem().
|
overrideprivatevirtual |
Reimplemented from GenericPanel.
Definition at line 153 of file elementspanel.cpp.
References QET::Icons::tr, and GenericPanel::updateTemplatesCollectionItem().
|
private |
pointer to the item representing the common templates collection
Definition at line 84 of file elementspanel.h.
Referenced by addProject(), and reload().
|
private |
pointer to the item representing the user templates collection
Definition at line 85 of file elementspanel.h.
Referenced by reload().
|
private |
Currently applied filter.
Definition at line 87 of file elementspanel.h.
Referenced by applyCurrentFilter(), buildFilterList(), filter(), and panelContentChange().
|
private |
Currently applied list of filter.
Definition at line 88 of file elementspanel.h.
Referenced by applyCurrentFilter(), and buildFilterList().
|
private |
used to distinguish the first time this panel is reloaded
Definition at line 86 of file elementspanel.h.
Referenced by addProject(), and reload().
|
private |
list of projects that have been added to this panel
Definition at line 83 of file elementspanel.h.
Referenced by addProject(), projectWasClosed(), projectWasOpened(), and reload().