diff --git a/src/application/xqchildmodel.cpp b/src/application/xqchildmodel.cpp index 0b16fc9..54bb88d 100644 --- a/src/application/xqchildmodel.cpp +++ b/src/application/xqchildmodel.cpp @@ -49,6 +49,7 @@ void XQChildModel::addModelData( const XQNodePtr& contentRoot ) // Das ist hier der Typ des Eintrags: Panel, Battery ... QString key = contentEntry->tag_name(); + // 'silent failure' hier der Datenbaum kann auch Knoten enthalten // die nicht für uns gedacht sind. if (!_sections.hasValidSection(key)) @@ -67,6 +68,14 @@ void XQChildModel::addModelData( const XQNodePtr& contentRoot ) // _hinter_ der letzen zeile einfügen insertRow( newRow+1, list); + if( contentEntry->has_children()) + { + qDebug() << " --- AddModelData: CHILD Found for: :" << contentEntry->tag_name() << " sheet parent: " << sheetNode->tag_name(); + if( !sheetNode->has_children() ) + qDebug() << " --- AUA"; + //else + } + } // for } diff --git a/src/application/xqmainwindow.cpp b/src/application/xqmainwindow.cpp index c7f8cee..70f8976 100644 --- a/src/application/xqmainwindow.cpp +++ b/src/application/xqmainwindow.cpp @@ -112,7 +112,7 @@ void XQMainWindow::initMainWindow() // #2. load demo data loadDocument( c_DocumentFileName1 ); - loadDocumentQML( c_DocumentFileName2 ); + //loadDocumentQML( c_DocumentFileName2 ); //loadDocument( c_DocumentFileName2 ); //loadDocument( c_DocumentFileName3 ); diff --git a/src/items/xqitemfactory.cpp b/src/items/xqitemfactory.cpp index b780ee4..6433cc6 100644 --- a/src/items/xqitemfactory.cpp +++ b/src/items/xqitemfactory.cpp @@ -105,7 +105,7 @@ XQItemType* XQItemFactory::makeItemType(const XQNodePtr& sheetEntry ) XQItemType* XQItemFactory::findItemTypeTemplate(const QString& key ) const { if( !key.isEmpty() && s_ItemTypeTemplates.contains(key)) - return s_ItemTypeTemplates[key]; + return s_ItemTypeTemplates[key]; throw XQException( "itemfactory: findItemTypeTemplate: not found:", key ); } @@ -136,54 +136,6 @@ void XQItemFactory::setItemTypeDataFromString( XQItem& item, const QString& role } - - -/// -/// ------------------------------------------------ -/// - -/* -XQItemList XQItemFactory::makeEmptyRow( const XQNodePtr& contentNode, const XQNodePtr& sheetNode ) -{ - Q_UNUSED(contentNode) - - XQItemList list; - - // create a data node for each sheet entry - size_t max = sheetNode->children().size(); - for( size_t i=0; ichildren() ) - { - QString value = "[" + sheetEntry->tag_name() + "]"; - if( sheetEntry->has_attribute("Unit") ) - value = "0"; - contentNode->set_attribute( sheetEntry->tag_name(), value ); - } - - if( sheetNode->has_attribute( c_FriendlyName ) ) - contentNode->set_attribute( c_FriendlyName, sheetNode->friendly_name() ); - - // now, we can create a normal entry row - return makeContentRow(contentNode, sheetNode ); - -} -*/ - - //! erzeugt eine item-row. XQItemList XQItemFactory::makeRow(const XQNodePtr& sheetNode, const XQNodePtr& contentNode ) @@ -213,6 +165,14 @@ 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 ein XQItem aus einer typ-beschreibung ('sheetNode') und einem daten-knoten ('contentNode'). //! Wenn der content node nicht gesetzt ist, wird stattdess das attribut 'Caption' aus der typ-beschreibung diff --git a/src/items/xqitemfactory.h b/src/items/xqitemfactory.h index 31e44b3..59636f8 100644 --- a/src/items/xqitemfactory.h +++ b/src/items/xqitemfactory.h @@ -33,6 +33,7 @@ public: XQNodePtr findModelSheet( const QString& modelName ) const; XQItemList makeRow( const XQNodePtr& sheetNode, const XQNodePtr& contentNode ); + XQItemList makeChildRow( XQItem* 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; diff --git a/xml/modeldata1.xtr b/xml/modeldata1.xtr index 205ea34..a53cecb 100644 --- a/xml/modeldata1.xtr +++ b/xml/modeldata1.xtr @@ -15,9 +15,9 @@ - - - + + + diff --git a/xml/modelsheets.xml b/xml/modelsheets.xml index ec9a8d6..f473ab7 100644 --- a/xml/modelsheets.xml +++ b/xml/modelsheets.xml @@ -124,8 +124,13 @@ - - + + + + + + + diff --git a/xml/saved_testfile.xtr b/xml/saved_testfile.xtr index 62c70bd..7a52cb6 100644 --- a/xml/saved_testfile.xtr +++ b/xml/saved_testfile.xtr @@ -6,10 +6,10 @@ - - + + - +