Enable section toggle

This commit is contained in:
2025-09-05 11:49:36 +02:00
parent 8d26c32e51
commit 9c6f7688d7
8 changed files with 96 additions and 69 deletions

View File

@@ -48,6 +48,25 @@ XQItem* XQMainModel::addProjectItem( XQNodePtr contentNode )
// wir durchsuchen alle unsere sections nach dem passenden content-type,
// hier: content-type beschreibt den projekt-status
const QString& sectionKey = contentNode->attribute(c_ContentType);
if( _sections.hasValidSection( sectionKey ) )
{
const XQModelSection& section = _sections.sectionByKey( sectionKey );
qDebug() << " --- add PROJECT: contentNode: " << contentNode->to_string();
// __fixme! das ist mist!
const XQNodePtr sheetNode = section.sheetRootNode()->first_child();
XQItem* newItem = _itemFactory.makeSingleItem( sheetNode, contentNode->attribute( "ProjectName") );
// den neuen eintrag in die passende section der übersicht eintragen ...
section.headerItem().appendRow( newItem );
// erzeuger sheet node speichern
newItem->setSheetNode( sheetNode );
expandNewItem(section.headerItem().index() );
return newItem;
}
/*
for(const auto& section : _sections )
{
if( contentNode->attribute(c_ContentType) == section.contentType() )
@@ -66,6 +85,7 @@ XQItem* XQMainModel::addProjectItem( XQNodePtr contentNode )
return newItem;
}
}
*/
throw XQException( "addProjectItem: main model should not be empty!" );
}