some fixes

This commit is contained in:
Christoph Holzheuer
2025-08-18 16:09:47 +02:00
parent 0f7299a74a
commit 429c939cdf
5 changed files with 57 additions and 33 deletions

View File

@@ -43,7 +43,7 @@ void XQMainModel::initContextMenu()
//! erzeugt einen eintrag in der baum-übersicht.
XQItem* XQMainModel::makeTreeItem( XQNodePtr contentNode )
XQItem* XQMainModel::addProjectItem( XQNodePtr contentNode )
{
// wir durchsuchen alle unsere section nach dem passenden content-type,
// hier: content-type beschreibt die
@@ -52,20 +52,21 @@ XQItem* XQMainModel::makeTreeItem( XQNodePtr contentNode )
if( contentNode->attribute( c_ContentType) == section.contentType() )
{
qDebug() << " --- wtf1: " << contentNode->to_string();
qDebug() << " --- wtf2: " << section.sectionRootNode()->to_string();
qDebug() << " --- wtf3: " << section.sheetRootNode()->to_string();
const QString* contentPtr = contentNode->attribute_ptr( "ProjectName" );
// __fixme! das ist mist!
XQItem* newItem = _itemFactory.makeItem(section.sheetRootNode()->child(0), contentPtr );
const XQNodePtr sheetNode = section.sheetRootNode()->first_child();
XQItem* newItem = _itemFactory.makeItem(sheetNode, contentPtr );
// den neuen eintrag in die passende section der übersicht eintragen ...
section.headerItem().appendRow( newItem );
_treeTable->expand( section.modelIndex() );
// ??
_treeTable->setCurrentIndex( section.modelIndex() );
newItem->setContentNode(contentNode);
// ... ausklappen...
const QModelIndex index = section.headerItem().index();
_treeTable->expand( index );
// ... und markieren
_treeTable->setCurrentIndex( index );
// den gesamten projekt knoten speichern, warum?
//newItem->setContentNode(contentNode);
// erzeuger sheet node speichern
newItem->setSheetNode( sheetNode );
emit itemCreated( newItem );
return newItem;
@@ -74,5 +75,15 @@ XQItem* XQMainModel::makeTreeItem( XQNodePtr contentNode )
}
throw XQException( "makeTreeItem: main model should not be empty!" );
throw XQException( "addProjectItem: main model should not be empty!" );
}
/*
XQItem* XQMainModel::addSectionItem( XQItem* projectItem )
{
const XQNodePtr& parentSheet = projectItem->sheetNode();
const XQNodePtr sheetNode = parentSheet->first_child();
return _itemFactor.makeItem( sheetNode, new QString("fitz!"));
}
*/