QElectroTech 0.100.0-dev
|
#include <elementscollectionmodel.h>
Inherits QStandardItemModel.
Signals | |
void | loadingProgressValueChanged (int) |
void | loadingProgressRangeChanged (int, int) |
void | loadingFinished () |
Public Member Functions | |
ElementsCollectionModel (QObject *parent=Q_NULLPTR) | |
ElementsCollectionModel::ElementsCollectionModel Constructor. | |
QVariant | data (const QModelIndex &index, int role) const override |
ElementsCollectionModel::data Reimplemented from QStandardItemModel. | |
QMimeData * | mimeData (const QModelIndexList &indexes) const override |
ElementsCollectionModel::mimeData Reimplemented from QStandardItemModel. | |
QStringList | mimeTypes () const override |
ElementsCollectionModel::mimeTypes Reimplemented from QStandardItemModel. | |
bool | canDropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override |
ElementsCollectionModel::canDropMimeData Reimplemented from QStandardItemModel. | |
bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override |
ElementsCollectionModel::dropMimeData Reimplemented from QStandardItemModel. | |
void | loadCollections (bool common_collection, bool company_collection, bool custom_collection, QList< QETProject * > projects) |
ElementsCollectionModel::loadCollections Load the several collections in this model. Prefer use this method instead of addCommonCollection, addCustomCollection and addProject, because it use multithreading to speed up the loading. This method emit loadingProgressRangeChanged(int, int) for know the minimu and maximum progress value This method emit loadingProgressValueChanged(int) for know the current progress value This method emit loadingFinished for know when loading finished. | |
void | addCommonCollection (bool set_data=true) |
ElementsCollectionModel::addCommonCollection Add the common elements collection to this model. | |
void | addCompanyCollection (bool set_data=true) |
ElementsCollectionModel::addCompanyCollection Add the company elements collection to this model. | |
void | addCustomCollection (bool set_data=true) |
ElementsCollectionModel::addCustomCollection Add the custom elements collection to this model. | |
void | addLocation (const ElementsLocation &location) |
ElementsCollectionModel::addLocation Add the element or directory to this model. If the location is already managed by this model, do nothing. | |
void | addProject (QETProject *project, bool set_data=true) |
ElementsCollectionModel::addProject Add project to this model. | |
void | removeProject (QETProject *project) |
ElementsCollectionModel::removeProject Remove project from this model. | |
QList< QETProject * > | project () const |
ElementsCollectionModel::project. | |
void | highlightUnusedElement () |
ElementsCollectionModel::highlightUnusedElement Highlight every unused element of managed project. | |
QList< ElementCollectionItem * > | items () const |
ElementsCollectionModel::items. | |
QList< ElementCollectionItem * > | projectItems (QETProject *project) const |
ElementsCollectionModel::projectItems. | |
void | hideElement () |
ElementsCollectionModel::hideElement Hide element in this model, only directory is managed. | |
bool | isHideElement () |
QModelIndex | indexFromLocation (const ElementsLocation &location) |
ElementsCollectionModel::indexFromLocation Return the index who represent location. Index can be non valid. | |
Private Member Functions | |
void | elementIntegratedToCollection (const QString &path) |
ElementsCollectionModel::elementIntegratedToCollection When an element is added to embedded collection of a project, this method create and display the new element. | |
void | itemRemovedFromCollection (const QString &path) |
ElementsCollectionModel::itemRemovedFromCollection This method must be called by a signal, to get a sender. | |
void | updateItem (const QString &path) |
ElementsCollectionModel::updateItem Update the item at path. | |
Private Attributes | |
QList< QETProject * > | m_project_list |
QHash< QETProject *, XmlProjectElementCollectionItem * > | m_project_hash |
bool | m_hide_element = false |
QFuture< void > | m_future |
QList< ElementCollectionItem * > | m_items_list_to_setUp |
ElementsCollectionModel::ElementsCollectionModel | ( | QObject * | parent = Q_NULLPTR | ) |
ElementsCollectionModel::ElementsCollectionModel Constructor.
parent |
void ElementsCollectionModel::addCommonCollection | ( | bool | set_data = true | ) |
ElementsCollectionModel::addCommonCollection Add the common elements collection to this model.
set_data |
void ElementsCollectionModel::addCompanyCollection | ( | bool | set_data = true | ) |
ElementsCollectionModel::addCompanyCollection Add the company elements collection to this model.
set_data |
void ElementsCollectionModel::addCustomCollection | ( | bool | set_data = true | ) |
ElementsCollectionModel::addCustomCollection Add the custom elements collection to this model.
set_data |
void ElementsCollectionModel::addLocation | ( | const ElementsLocation & | location | ) |
ElementsCollectionModel::addLocation Add the element or directory to this model. If the location is already managed by this model, do nothing.
location |
void ElementsCollectionModel::addProject | ( | QETProject * | project, |
bool | set_data = true |
||
) |
ElementsCollectionModel::addProject Add project to this model.
project | : project to add. |
set_data | : if true, setUpData is called for every ElementCollectionItem of project |
|
override |
ElementsCollectionModel::canDropMimeData Reimplemented from QStandardItemModel.
data | |
action | |
row | |
column | |
parent |
|
override |
ElementsCollectionModel::data Reimplemented from QStandardItemModel.
index | |
role |
|
override |
ElementsCollectionModel::dropMimeData Reimplemented from QStandardItemModel.
data | |
action | |
row | |
column | |
parent |
|
private |
ElementsCollectionModel::elementIntegratedToCollection When an element is added to embedded collection of a project, this method create and display the new element.
path | : -The path of the new element in the embedded collection of a project |
void ElementsCollectionModel::hideElement | ( | ) |
ElementsCollectionModel::hideElement Hide element in this model, only directory is managed.
void ElementsCollectionModel::highlightUnusedElement | ( | ) |
ElementsCollectionModel::highlightUnusedElement Highlight every unused element of managed project.
QModelIndex ElementsCollectionModel::indexFromLocation | ( | const ElementsLocation & | location | ) |
ElementsCollectionModel::indexFromLocation Return the index who represent location. Index can be non valid.
location |
|
inline |
|
private |
ElementsCollectionModel::itemRemovedFromCollection This method must be called by a signal, to get a sender.
path |
QList< ElementCollectionItem * > ElementsCollectionModel::items | ( | ) | const |
ElementsCollectionModel::items.
void ElementsCollectionModel::loadCollections | ( | bool | common_collection, |
bool | company_collection, | ||
bool | custom_collection, | ||
QList< QETProject * > | projects | ||
) |
ElementsCollectionModel::loadCollections Load the several collections in this model. Prefer use this method instead of addCommonCollection, addCustomCollection and addProject, because it use multithreading to speed up the loading. This method emit loadingProgressRangeChanged(int, int) for know the minimu and maximum progress value This method emit loadingProgressValueChanged(int) for know the current progress value This method emit loadingFinished for know when loading finished.
common_collection | : true for load the common collection |
custom_collection | : true for load the custom collection |
projects | : list of projects to load |
|
signal |
|
signal |
|
signal |
|
override |
ElementsCollectionModel::mimeData Reimplemented from QStandardItemModel.
indexes |
|
override |
ElementsCollectionModel::mimeTypes Reimplemented from QStandardItemModel.
QList< QETProject * > ElementsCollectionModel::project | ( | ) | const |
ElementsCollectionModel::project.
QList< ElementCollectionItem * > ElementsCollectionModel::projectItems | ( | QETProject * | project | ) | const |
ElementsCollectionModel::projectItems.
project |
void ElementsCollectionModel::removeProject | ( | QETProject * | project | ) |
ElementsCollectionModel::removeProject Remove project from this model.
project |
|
private |
ElementsCollectionModel::updateItem Update the item at path.
path |
|
private |
|
private |
|
private |
|
private |
|
private |