89 if (
m_path.endsWith(
".elmt"))
111 if (!text().isNull())
127 if (dir_conf.exists() && dir_conf.open(QIODevice::ReadOnly | QIODevice::Text)) {
130 QDomDocument document;
131 if (document.setContent(&dir_conf)) {
132 QDomElement root = document.documentElement();
133 if (root.tagName() ==
"qet-directory") {
222 if (collection_name.isEmpty())
241 setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsEnabled);
244 setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled);
250 QStringList search_list;
251 for (QString key : context.
keys()) {
252 search_list.append(context.
value(key).toString());
255 setData(search_list.join(
" "));
268 if (!icon().isNull())
273 setIcon(QIcon(
":/ico/16x16/qet.png"));
275 setIcon(QIcon(
":/ico/16x16/go-home.png"));
299 if (!path_name.endsWith(
".elmt"))
313 foreach(QString str, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name))
326 dir.setNameFilters(QStringList() <<
"*.elmt");
327 foreach(QString str, dir.entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::Name))
The ElementCollectionItem class This class represent a item (a directory or an element) in a element ...
virtual bool isCollectionRoot() const =0
bool isCustomCollection() const
FileElementCollectionItem::isCustomCollection.
QVariant value(const QString &key) const
QString collectionPath() const override
FileElementCollectionItem::collectionPath.
QIcon icon() const
ElementLocation::icon.
DiagramContext elementInformations() const
ElementsLocation::elementInformations.
QList< QString > keys(KeyOrder=None) const
int type() const override
void addChildAtPath(const QString &collection_name) override
FileElementCollectionItem::addChildAtPath Ask to this item item to add a child with collection name ...
void populate(bool set_data=true, bool hide_element=false)
FileElementCollectionItem::populate Create the childs of this item.
void setPathName(const QString &path_name, bool set_data=true, bool hide_element=false)
FileElementCollectionItem::setPathName Set the name of this item in the file system path...
void setUpIcon() override
FileElementCollectionItem::setUpIcon SetUp the icon of this item. Because icon use several memory...
FileElementCollectionItem()
FileElementCollectionItem::FileElementCollectionItem Constructor.
bool isCommonCollection() const
FileElementCollectionItem::isCommonCollection.
QString name() const
ElementLocation::name.
void setUpData() override
FileElementCollectionItem::setUpData SetUp the data of this item.
QString name() const override
FileElementCollectionItem::name.
The FileElementCollectionItem class This class specialise ElementCollectionItem for manage a collecti...
virtual QString collectionPath() const =0
int rowForInsertItem(const QString &name)
ElementCollectionItem::rowForInsertItem Return the row for insert a new child item to this item with ...
bool setRootPath(const QString &path, bool set_data=true, bool hide_element=false)
FileElementCollectionItem::setRootPath Set path has root path for this file item. Use this function o...
static QString customElementsDirN()
QETApp::customElementsDirN like QString QETApp::customElementsDir but without "/" at the end...
QString localName() override
FileElementCollectionItem::localName.
QString dirPath() const
FileElementCollectionItem::dirPath.
QString fileSystemPath() const
FileElementCollectionItem::fileSystemPath.
static QString commonElementsDirN()
QETApp::commonElementsDirN like QString QETApp::commonElementsDir but without "/" at the end...
bool isCollectionRoot() const override
FileElementCollectionItem::isCollectionRoot.
bool isElement() const override
FileElementCollectionItem::isElement.
bool isDir() const override
FileElementCollectionItem::isDir.