67 setText(location.
name());
138 if (collection_name.isEmpty())
141 QString str (collection_name.endsWith(
".elmt")?
"element" :
"category");
142 QDomElement child_element =
m_dom_element.firstChildElement(str);
144 while (!child_element.isNull()) {
145 if (child_element.attribute(
"name") == collection_name) {
153 child_element = child_element.nextSiblingElement(str);
193 setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsEnabled);
197 setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled);
203 QStringList search_list;
204 for (QString key : context.
keys()) {
205 search_list.append(context.
value(key).toString());
208 setData(search_list.join(
" "));
221 if (!icon().isNull())
242 std::sort(dom_category.begin(), dom_category.end(), [](QDomElement a, QDomElement b){
return (a.attribute(
"name") < b.attribute(
"name"));});
244 foreach (QDomElement element, dom_category)
257 std::sort(dom_elements.begin(), dom_elements.end(), [](QDomElement a, QDomElement b){
return (a.attribute(
"name") < b.attribute(
"name"));});
259 foreach (QDomElement element, dom_elements)
QString projectCollectionPath() const
ElementsLocation::projectCollectionPath.
XmlProjectElementCollectionItem()
XmlProjectElementCollectionItem::XmlProjectElementCollectionItem Constructor.
bool isDir() const override
XmlProjectElementCollectionItem::isDir.
QString collectionPath() const override
XmlProjectElementCollectionItem::collectionPath.
void setUpData() override
XmlProjectElementCollectionItem::setUpData SetUp the data of this item.
QVariant value(const QString &key) const
QDomElement root() const
XmlElementCollection::root The root is the first DOM-Element the xml collection, the tag name of the ...
QIcon icon() const
ElementLocation::icon.
void setUpIcon() override
XmlProjectElementCollectionItem::setUpIcon SetUp the icon of this item. Because icon use several memo...
The XmlProjectElementCollectionItem class This class specialise ElementCollectionItem for manage an x...
XmlElementCollection * embeddedElementCollection() const
QETProject::embeddedCollection.
DiagramContext elementInformations() const
ElementsLocation::elementInformations.
QList< QString > keys(KeyOrder=None) const
QList< QDomElement > directories(const QDomElement &parent_element) const
XmlElementCollection::directories.
QString name() const override
XmlProjectElementCollectionItem::name.
QETProject * project() const
XmlProjectElementCollectionItem::project.
QList< QDomElement > elements(const QDomElement &parent_element) const
XmlElementCollection::elements.
QString name() const
ElementLocation::name.
QDomElement m_dom_element
void setXmlElement(const QDomElement &element, QETProject *project, bool set_data=true, bool hide_element=false)
XmlProjectElementCollectionItem::setXmlElement Set the managed content of this item.
void setProject(QETProject *project, bool set_data=true, bool hide_element=false)
XmlProjectElementCollectionItem::setProject Set the project for this item. Use this method for set th...
int rowForInsertItem(const QString &name)
ElementCollectionItem::rowForInsertItem Return the row for insert a new child item to this item with ...
void addChildAtPath(const QString &collection_name) override
XmlProjectElementCollectionItem::addChildAtPath Ask to this item item to add a new child with collect...
int type() const override
QString localName() override
XmlProjectElementCollectionItem::localName.
bool isCollectionRoot() const override
XmlProjectElementCollectionItem::isCollectionRoot.
virtual QString embeddedPath() const
XmlProjectElementCollectionItem::embeddedPath.
bool isElement() const override
XmlProjectElementCollectionItem::isElement.
void populate(bool set_data=true, bool hide_element=false)
XmlProjectElementCollectionItem::populate Create the childs of this item.