diff --git a/src/application/xqchildmodel.cpp b/src/application/xqchildmodel.cpp index 828a744..98dbb42 100644 --- a/src/application/xqchildmodel.cpp +++ b/src/application/xqchildmodel.cpp @@ -90,9 +90,8 @@ void XQChildModel::addModelData( const XQNodePtr& contentRoot ) if( !sheetNode->first_child()->has_children() ) continue; - XQItemList childList = _itemFactory.makeRow( sheetNode, contentEntry ); - // als kinder einfügen - list.front()->appendRow( childList ); + XQItemList childList =_itemFactory.makeChildRow( list.front(), sheetNode->first_child(), contentEntry ); + } } // for diff --git a/src/items/xqitemfactory.cpp b/src/items/xqitemfactory.cpp index 75cd5cc..cc75751 100644 --- a/src/items/xqitemfactory.cpp +++ b/src/items/xqitemfactory.cpp @@ -170,7 +170,7 @@ XQItemList XQItemFactory::makeRow(const XQNodePtr& sheetNode, const XQNodePtr& c //! Erzeugt kind-items zu einem section-eintrag. -XQItemList XQItemFactory::makeChildRow( const XQNodePtr& sheetNode, const XQNodePtr& contentNode ) +XQItemList XQItemFactory::makeChildRow( QStandardItem* parent, const XQNodePtr& sheetNode, const XQNodePtr& contentNode ) { XQItemList list; for (const auto& contentChild : contentNode->children()) @@ -181,6 +181,10 @@ XQItemList XQItemFactory::makeChildRow( const XQNodePtr& sheetNode, const XQNode { const XQNodePtr& sheetChild = sheetNode->child(contentKey); list = makeRow( sheetChild, contentChild ); + // als kinder einfügen + //insertRow( parent->row()+1, list ); + parent->appendRow( list ); + } } return list; diff --git a/src/items/xqitemfactory.h b/src/items/xqitemfactory.h index a93cc1c..6626da6 100644 --- a/src/items/xqitemfactory.h +++ b/src/items/xqitemfactory.h @@ -34,7 +34,7 @@ public: // __fix auf nicht vorhandenen content felder prüfen! vereinheitlichen! XQItemList makeRow( const XQNodePtr& sheetNode, const XQNodePtr& contentNode ); - XQItemList makeChildRow( const XQNodePtr& sheetNode, const XQNodePtr& contentNode ); + XQItemList makeChildRow( QStandardItem* parent, 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;