QElectroTech  0.8-dev
Public Slots | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ElementsCollectionWidget Class Reference

The ElementsCollectionWidget class This widget embedd a tree view that display the element collection (common, custom, embedded) and all action needed to use this widget. This is the element collection widget used in the diagram editor. More...

#include <elementscollectionwidget.h>

Inherits QWidget.

Collaboration diagram for ElementsCollectionWidget:
Collaboration graph

Public Slots

void reload ()
 ElementsCollectionWidget::reload, the displayed collections. More...
 
void loadingFinished ()
 ElementsCollectionWidget::loadingFinished Process when collection finished to be loaded. More...
 

Public Member Functions

 ElementsCollectionWidget (QWidget *parent=nullptr)
 ElementsCollectionWidget::ElementsCollectionWidget Default constructor. More...
 
void expandFirstItems ()
 ElementsCollectionWidget::expandFirstItems Expand each first item in the tree view. More...
 
void addProject (QETProject *project)
 ElementsCollectionWidget::addProject Add project to be displayed. More...
 
void removeProject (QETProject *project)
 
void highlightUnusedElement ()
 ElementsCollectionWidget::highlightUnusedElement highlight the unused element. More...
 
void setCurrentLocation (const ElementsLocation &location)
 ElementsCollectionWidget::setCurrentLocation Set the current item to be the item for location. More...
 

Protected Member Functions

void leaveEvent (QEvent *event) override
 

Private Member Functions

void setUpAction ()
 
void setUpWidget ()
 ElementsCollectionWidget::setUpWidget Setup this widget. More...
 
void setUpConnection ()
 ElementsCollectionWidget::setUpConnection Setup the connection used in this widget. More...
 
void customContextMenu (const QPoint &point)
 ElementsCollectionWidget::customContextMenu Display the context menu of this widget at point. More...
 
void openDir ()
 ElementsCollectionWidget::openDir Open the directory represented by the current selected item. More...
 
void editElement ()
 ElementsCollectionWidget::editElement Edit the element represented by the current selected item. More...
 
void deleteElement ()
 ElementsCollectionWidget::deleteElement Delete the element represented by the current selected item. More...
 
void deleteDirectory ()
 ElementsCollectionWidget::deleteDirectory Delete directory represented by the current selected item. More...
 
void editDirectory ()
 ElementsCollectionWidget::editDirectory Edit the directory represented by the current selected item. More...
 
void newDirectory ()
 ElementsCollectionWidget::newDirectory Create a new directory. More...
 
void newElement ()
 ElementsCollectionWidget::newElement Create a new element. More...
 
void showThisDir ()
 ElementsCollectionWidget::showThisDir Hide all directories except the pointed dir;. More...
 
void resetShowThisDir ()
 ElementsCollectionWidget::resetShowThisDir reset show this dir, all collection are show. If search field isn't empty, apply the search after show all collection. More...
 
void dirProperties ()
 ElementsCollectionWidget::dirProperties Open an informative dialog about the curent index. More...
 
void search ()
 ElementsCollectionWidget::search Search every item (directory or element) that match the text of m_search_field and display it, other item who does not match text is hidden. More...
 
void hideCollection (bool hide=true)
 ElementsCollectionWidget::hideCollection Hide all collection displayed in this tree. More...
 
void hideItem (bool hide, const QModelIndex &index=QModelIndex(), bool recursive=true)
 ElementsCollectionWidget::hideItem Hide the item index. If recursive is true, hide all subchilds of index. More...
 
void showAndExpandItem (const QModelIndex &index, bool parent=true, bool child=false)
 ElementsCollectionWidget::showAndExpandItem Show the item index and expand it. If parent is true, ensure parents of index is show and expanded If child is true, ensure all childs of index is show and expended. More...
 
ElementCollectionItemelementCollectionItemForIndex (const QModelIndex &index)
 ElementsCollectionWidget::elementCollectionItemForIndex. More...
 
void locationWasSaved (const ElementsLocation &location)
 ElementsCollectionWidget::locationWasSaved This method is connected with the signal savedToLocation of Element editor (see ElementsCollectionWidget::editElement()) Update or add the item represented by location to m_model. More...
 

Private Attributes

ElementsCollectionModelm_model = nullptr
 
ElementsCollectionModelm_new_model = nullptr
 
QLineEdit * m_search_field
 
QTimer m_search_timer
 
ElementsTreeViewm_tree_view
 
QVBoxLayout * m_main_vlayout
 
QMenu * m_context_menu
 
QModelIndex m_index_at_context_menu
 
QModelIndex m_showed_index
 
QProgressBar * m_progress_bar
 
QAction * m_open_dir
 
QAction * m_edit_element
 
QAction * m_delete_element
 
QAction * m_delete_dir
 
QAction * m_reload
 
QAction * m_edit_dir
 
QAction * m_new_directory
 
QAction * m_new_element
 
QAction * m_show_this_dir
 
QAction * m_show_all_dir
 
QAction * m_dir_propertie
 
bool m_first_show = true
 
QList< QETProject * > m_waiting_project
 

Detailed Description

The ElementsCollectionWidget class This widget embedd a tree view that display the element collection (common, custom, embedded) and all action needed to use this widget. This is the element collection widget used in the diagram editor.

Constructor & Destructor Documentation

◆ ElementsCollectionWidget()

ElementsCollectionWidget::ElementsCollectionWidget ( QWidget *  parent = nullptr)

ElementsCollectionWidget::ElementsCollectionWidget Default constructor.

Parameters
parent: parent widget of this widget.
Here is the call graph for this function:

Member Function Documentation

◆ addProject()

void ElementsCollectionWidget::addProject ( QETProject project)

ElementsCollectionWidget::addProject Add project to be displayed.

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

◆ customContextMenu()

void ElementsCollectionWidget::customContextMenu ( const QPoint &  point)
private

ElementsCollectionWidget::customContextMenu Display the context menu of this widget at point.

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

◆ deleteDirectory()

void ElementsCollectionWidget::deleteDirectory ( )
private

ElementsCollectionWidget::deleteDirectory Delete directory represented by the current selected item.

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

◆ deleteElement()

void ElementsCollectionWidget::deleteElement ( )
private

ElementsCollectionWidget::deleteElement Delete the element represented by the current selected item.

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

◆ dirProperties()

void ElementsCollectionWidget::dirProperties ( )
private

ElementsCollectionWidget::dirProperties Open an informative dialog about the curent index.

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

◆ editDirectory()

void ElementsCollectionWidget::editDirectory ( )
private

ElementsCollectionWidget::editDirectory Edit the directory represented by the current selected item.

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

◆ editElement()

void ElementsCollectionWidget::editElement ( )
private

ElementsCollectionWidget::editElement Edit the element represented by the current selected item.

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

◆ elementCollectionItemForIndex()

ElementCollectionItem * ElementsCollectionWidget::elementCollectionItemForIndex ( const QModelIndex &  index)
private

ElementsCollectionWidget::elementCollectionItemForIndex.

Parameters
index
Returns
The internal pointer of index casted to ElementCollectionItem;
Here is the caller graph for this function:

◆ expandFirstItems()

void ElementsCollectionWidget::expandFirstItems ( )

ElementsCollectionWidget::expandFirstItems Expand each first item in the tree view.

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

◆ hideCollection()

void ElementsCollectionWidget::hideCollection ( bool  hide = true)
private

ElementsCollectionWidget::hideCollection Hide all collection displayed in this tree.

Parameters
hide-true = hide , false = visible
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hideItem()

void ElementsCollectionWidget::hideItem ( bool  hide,
const QModelIndex &  index = QModelIndex(),
bool  recursive = true 
)
private

ElementsCollectionWidget::hideItem Hide the item index. If recursive is true, hide all subchilds of index.

Parameters
hide: - true = hide , false = visible
index: - index to hide
recursive: - true = apply to child , false = only for index
Here is the caller graph for this function:

◆ highlightUnusedElement()

void ElementsCollectionWidget::highlightUnusedElement ( )

ElementsCollectionWidget::highlightUnusedElement highlight the unused element.

See also
ElementsCollectionModel::highlightUnusedElement()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ leaveEvent()

void ElementsCollectionWidget::leaveEvent ( QEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ loadingFinished

void ElementsCollectionWidget::loadingFinished ( )
slot

ElementsCollectionWidget::loadingFinished Process when collection finished to be loaded.

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

◆ locationWasSaved()

void ElementsCollectionWidget::locationWasSaved ( const ElementsLocation location)
private

ElementsCollectionWidget::locationWasSaved This method is connected with the signal savedToLocation of Element editor (see ElementsCollectionWidget::editElement()) Update or add the item represented by location to m_model.

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

◆ newDirectory()

void ElementsCollectionWidget::newDirectory ( )
private

ElementsCollectionWidget::newDirectory Create a new directory.

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

◆ newElement()

void ElementsCollectionWidget::newElement ( )
private

ElementsCollectionWidget::newElement Create a new element.

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

◆ openDir()

void ElementsCollectionWidget::openDir ( )
private

ElementsCollectionWidget::openDir Open the directory represented by the current selected item.

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

◆ reload

void ElementsCollectionWidget::reload ( )
slot

ElementsCollectionWidget::reload, the displayed collections.

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

◆ removeProject()

void ElementsCollectionWidget::removeProject ( QETProject project)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetShowThisDir()

void ElementsCollectionWidget::resetShowThisDir ( )
private

ElementsCollectionWidget::resetShowThisDir reset show this dir, all collection are show. If search field isn't empty, apply the search after show all collection.

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

◆ search()

void ElementsCollectionWidget::search ( )
private

ElementsCollectionWidget::search Search every item (directory or element) that match the text of m_search_field and display it, other item who does not match text is hidden.

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

◆ setCurrentLocation()

void ElementsCollectionWidget::setCurrentLocation ( const ElementsLocation location)

ElementsCollectionWidget::setCurrentLocation Set the current item to be the item for location.

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

◆ setUpAction()

void ElementsCollectionWidget::setUpAction ( )
private
Here is the caller graph for this function:

◆ setUpConnection()

void ElementsCollectionWidget::setUpConnection ( )
private

ElementsCollectionWidget::setUpConnection Setup the connection used in this widget.

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

◆ setUpWidget()

void ElementsCollectionWidget::setUpWidget ( )
private

ElementsCollectionWidget::setUpWidget Setup this widget.

Here is the caller graph for this function:

◆ showAndExpandItem()

void ElementsCollectionWidget::showAndExpandItem ( const QModelIndex &  index,
bool  parent = true,
bool  child = false 
)
private

ElementsCollectionWidget::showAndExpandItem Show the item index and expand it. If parent is true, ensure parents of index is show and expanded If child is true, ensure all childs of index is show and expended.

Parameters
index-index to show
parent-Apply to parent
child-Apply to all childs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ showThisDir()

void ElementsCollectionWidget::showThisDir ( )
private

ElementsCollectionWidget::showThisDir Hide all directories except the pointed dir;.

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

Member Data Documentation

◆ m_context_menu

QMenu* ElementsCollectionWidget::m_context_menu
private

◆ m_delete_dir

QAction * ElementsCollectionWidget::m_delete_dir
private

◆ m_delete_element

QAction * ElementsCollectionWidget::m_delete_element
private

◆ m_dir_propertie

QAction * ElementsCollectionWidget::m_dir_propertie
private

◆ m_edit_dir

QAction * ElementsCollectionWidget::m_edit_dir
private

◆ m_edit_element

QAction * ElementsCollectionWidget::m_edit_element
private

◆ m_first_show

bool ElementsCollectionWidget::m_first_show = true
private

◆ m_index_at_context_menu

QModelIndex ElementsCollectionWidget::m_index_at_context_menu
private

◆ m_main_vlayout

QVBoxLayout* ElementsCollectionWidget::m_main_vlayout
private

◆ m_model

ElementsCollectionModel* ElementsCollectionWidget::m_model = nullptr
private

◆ m_new_directory

QAction * ElementsCollectionWidget::m_new_directory
private

◆ m_new_element

QAction * ElementsCollectionWidget::m_new_element
private

◆ m_new_model

ElementsCollectionModel* ElementsCollectionWidget::m_new_model = nullptr
private

◆ m_open_dir

QAction* ElementsCollectionWidget::m_open_dir
private

◆ m_progress_bar

QProgressBar* ElementsCollectionWidget::m_progress_bar
private

◆ m_reload

QAction * ElementsCollectionWidget::m_reload
private

◆ m_search_field

QLineEdit* ElementsCollectionWidget::m_search_field
private

◆ m_search_timer

QTimer ElementsCollectionWidget::m_search_timer
private

◆ m_show_all_dir

QAction * ElementsCollectionWidget::m_show_all_dir
private

◆ m_show_this_dir

QAction * ElementsCollectionWidget::m_show_this_dir
private

◆ m_showed_index

QModelIndex ElementsCollectionWidget::m_showed_index
private

◆ m_tree_view

ElementsTreeView* ElementsCollectionWidget::m_tree_view
private

◆ m_waiting_project

QList<QETProject *> ElementsCollectionWidget::m_waiting_project
private

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