added access on tag_name and tag_value

This commit is contained in:
2025-08-23 14:37:36 +02:00
parent 769ad2b002
commit 3a5fbad33e
14 changed files with 89 additions and 32 deletions

View File

@@ -33,7 +33,7 @@ XQChildModel::XQChildModel( QObject *parent )
//! erzegt den sichtbaren inhalt des models aus einem root-datenknoten.
void XQChildModel::setContent( const XQNodePtr& contentRoot )
void XQChildModel::addModelData( const XQNodePtr& contentRoot )
{
// __fix: set object name ??
@@ -59,6 +59,9 @@ void XQChildModel::setContent( const XQNodePtr& contentRoot )
// wir speichern das parent des datenknoten auch in der
// section.
// contentEntry->parent == _contentRoot, aber halt nur weil das model flach ist
qDebug() << " --- add section ENTRY: " << key << " TagName: " << contentEntry->attribute("TagName");
section.setContentRootNode( contentEntry->parent() );
int newRow = _sections.lastRow(section);
@@ -73,6 +76,18 @@ void XQChildModel::setContent( const XQNodePtr& contentRoot )
}
void XQChildModel::addSectionEntry( const QString& key, const XQNodePtr& contentEntry )
{
XQModelSection& section = _sections.at( key );
if(section.isValid() )
{
section.setContentRootNode( contentEntry->parent() );
int newRow = _sections.lastRow(section);
XQNodePtr sheetNode = section.sheetRootNode();
XQItemList list = _itemFactory.makeRow( sheetNode, contentEntry );
insertRow( newRow, list);
}
}
//! erzeugt ein adhoc-contextmenu, je nachdem welche aktionen gerade möflich sind.

View File

@@ -29,7 +29,8 @@ public:
explicit XQChildModel(QObject *parent = nullptr);
virtual ~XQChildModel() = default;
void setContent(const XQNodePtr& contentRoot );
void addModelData(const XQNodePtr& contentRoot );
void addSectionEntry(const QString& key, const XQNodePtr& contentEntry );
protected:

View File

@@ -355,7 +355,7 @@ void XQMainWindow::loadDocument( const QString& fileName )
childModel->initModel( c_ChildModelName );
// model inhalte laden
childModel->setContent( contentRoot->first_child() );
childModel->addModelData( contentRoot->first_child() );
}