QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
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.
 
void loadingFinished ()
 ElementsCollectionWidget::loadingFinished Process when collection finished to be loaded.
 

Public Member Functions

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

Protected Member Functions

void leaveEvent (QEvent *event) override
 

Private Member Functions

void setUpAction ()
 
void setUpWidget ()
 ElementsCollectionWidget::setUpWidget Setup this widget.
 
void setUpConnection ()
 ElementsCollectionWidget::setUpConnection Setup the connection used in this widget.
 
void customContextMenu (const QPoint &point)
 ElementsCollectionWidget::customContextMenu Display the context menu of this widget at point.
 
void openDir ()
 ElementsCollectionWidget::openDir Open the directory represented by the current selected item.
 
void editElement ()
 ElementsCollectionWidget::editElement Edit the element represented by the current selected item.
 
void deleteElement ()
 ElementsCollectionWidget::deleteElement Delete the element represented by the current selected item.
 
void deleteDirectory ()
 ElementsCollectionWidget::deleteDirectory Delete directory represented by the current selected item.
 
void editDirectory ()
 ElementsCollectionWidget::editDirectory Edit the directory represented by the current selected item.
 
void newDirectory ()
 ElementsCollectionWidget::newDirectory Create a new directory.
 
void newElement ()
 ElementsCollectionWidget::newElement Create a new element.
 
void showThisDir ()
 ElementsCollectionWidget::showThisDir Hide all directories except the pointed dir;.
 
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.
 
void dirProperties ()
 ElementsCollectionWidget::dirProperties Open an informative dialog about the current index.
 
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.
 
void hideCollection (bool hide=true)
 ElementsCollectionWidget::hideCollection Hide all collection displayed in this tree.
 
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.
 
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.
 
ElementCollectionItemelementCollectionItemForIndex (const QModelIndex &index)
 ElementsCollectionWidget::elementCollectionItemForIndex.
 
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.
 

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
 
QScopedPointer< QElapsedTimer > m_loading_timer
 

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 current 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 call graph for this function:
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_loading_timer

QScopedPointer<QElapsedTimer> ElementsCollectionWidget::m_loading_timer
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: