Moved child row creation to XQItemFactory, some other cleanups.

This commit is contained in:
2025-09-28 14:15:18 +02:00
parent 007970f4ee
commit f74c004bf9
7 changed files with 32 additions and 56 deletions

View File

@@ -167,13 +167,23 @@ XQItemList XQItemFactory::makeRow(const XQNodePtr& sheetNode, const XQNodePtr& c
return list;
}
XQItemList XQItemFactory::makeChildRow( XQItem* parent, const XQNodePtr& sheetNode, const XQNodePtr& contentNode )
{
Q_UNUSED(parent);
Q_UNUSED(sheetNode);
Q_UNUSED(contentNode);
return XQItemList();
//! Erzeugt kind-items zu einem section-eintrag.
XQItemList XQItemFactory::makeChildRow( const XQNodePtr& sheetNode, const XQNodePtr& contentNode )
{
XQItemList list;
for (const auto& contentChild : contentNode->children())
{
const QString& contentKey = contentChild->tag_name();
// wir brauchen ein beschreibenden sheetnode für diesen content-child knoten
if( sheetNode->has_child( contentKey ))
{
const XQNodePtr& sheetChild = sheetNode->child(contentKey);
list = makeRow( sheetChild, contentChild );
}
}
return list;
}
//! Erzeugt ein XQItem aus einer typ-beschreibung ('sheetNode') und einem daten-knoten ('contentNode').

View File

@@ -32,8 +32,9 @@ public:
XQNodePtr findModelSheet( const QString& modelName ) const;
// __fix auf nicht vorhandenen content felder prüfen! vereinheitlichen!
XQItemList makeRow( const XQNodePtr& sheetNode, const XQNodePtr& contentNode );
XQItemList makeChildRow( XQItem* parent, const XQNodePtr& sheetNode, const XQNodePtr& contentNode );
XQItemList makeChildRow( const XQNodePtr& sheetNode, const XQNodePtr& contentNode );
XQItem* makeSingleItem( const XQNodePtr& sheetNode, const QString& caption );
void setItemTypeDataFromString( XQItem& item, const QString& roleKey, const QString& source ) const;