18 #ifndef ELEMENTSCOLLECTIONMODEL2_H 19 #define ELEMENTSCOLLECTIONMODEL2_H 21 #include <QStandardItemModel> 38 QVariant
data(
const QModelIndex &index,
int role)
const override;
39 QMimeData *
mimeData(
const QModelIndexList &indexes)
const override;
41 bool canDropMimeData(
const QMimeData *
data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent)
const override;
42 bool dropMimeData(
const QMimeData *
data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent)
override;
44 void loadCollections(
bool common_collection,
bool custom_collection, QList<QETProject *> projects);
52 QList<QETProject *>
project()
const;
56 QList <ElementCollectionItem *>
items()
const;
77 #endif // ELEMENTSCOLLECTIONMODEL2_H The ElementCollectionItem class This class represent a item (a directory or an element) in a element ...
void addCommonCollection(bool set_data=true)
ElementsCollectionModel::addCommonCollection Add the common elements collection to this model...
QVariant data(const QModelIndex &index, int role) const override
ElementsCollectionModel::data Reimplemented from QStandardItemModel.
QList< ElementCollectionItem * > projectItems(QETProject *project) const
ElementsCollectionModel::projectItems.
void highlightUnusedElement()
ElementsCollectionModel::highlightUnusedElement Highlight every unused element of managed project...
ElementsCollectionModel(QObject *parent=Q_NULLPTR)
ElementsCollectionModel::ElementsCollectionModel Constructor.
void loadingProgressValue(int)
QHash< QETProject *, XmlProjectElementCollectionItem * > m_project_hash
QList< QETProject * > project() const
ElementsCollectionModel::project.
QStringList mimeTypes() const override
ElementsCollectionModel::mimeTypes Reimplemented from QStandardItemModel.
The XmlProjectElementCollectionItem class This class specialise ElementCollectionItem for manage an x...
void removeProject(QETProject *project)
ElementsCollectionModel::removeProject Remove project from this model.
void loadCollections(bool common_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 loadingMaxValue(int) for know the maximum progress value This method emit loadingProgressValue(int) for know the current progress value.
void elementIntegratedToCollection(const QString &path)
ElementsCollectionModel::elementIntegratedToCollection When an element is added to embedded collectio...
QList< ElementCollectionItem * > items() const
ElementsCollectionModel::items.
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override
ElementsCollectionModel::canDropMimeData Reimplemented from QStandardItemModel.
void addLocation(const ElementsLocation &location)
ElementsCollectionModel::addLocation Add the element or directory to this model. If the location is a...
void hideElement()
ElementsCollectionModel::hideElement Hide element in this model, only directory is managed...
QList< QETProject * > m_project_list
void itemRemovedFromCollection(const QString &path)
ElementsCollectionModel::itemRemovedFromCollection This method must be called by a signal...
void updateItem(const QString &path)
ElementsCollectionModel::updateItem Update the item at path.
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
ElementsCollectionModel::dropMimeData Reimplemented from QStandardItemModel.
void addProject(QETProject *project, bool set_data=true)
ElementsCollectionModel::addProject Add project to this model.
void loadingMaxValue(int)
QMimeData * mimeData(const QModelIndexList &indexes) const override
ElementsCollectionModel::mimeData Reimplemented from QStandardItemModel.
void addCustomCollection(bool set_data=true)
ElementsCollectionModel::addCustomCollection Add the custom elements collection to this model...
QModelIndex indexFromLocation(const ElementsLocation &location)
ElementsCollectionModel::indexFromLocation Return the index who represent . Index can be non valid...