-- pre-holiday
This commit is contained in:
@@ -66,7 +66,7 @@ void XQChildModel::addModelData( const XQNodePtr& contentRoot )
|
||||
int newRow = _sections.lastRow(section);
|
||||
|
||||
XQNodePtr sheetNode = section.sheetRootNode();
|
||||
XQItemList list = _itemFactory.makeRow( XQItemFactory::mData, sheetNode, contentEntry );
|
||||
XQItemList list = _itemFactory.makeRow( sheetNode, contentEntry );
|
||||
|
||||
// als Baum?
|
||||
//section.headerItem().appendRow( list );
|
||||
@@ -84,7 +84,7 @@ void XQChildModel::addSectionEntry( const QString& key, const XQNodePtr& content
|
||||
section.setContentRootNode( contentEntry->parent() );
|
||||
int newRow = _sections.lastRow(section);
|
||||
XQNodePtr sheetNode = section.sheetRootNode();
|
||||
XQItemList list = _itemFactory.makeRow( XQItemFactory::mHeader, sheetNode, contentEntry );
|
||||
XQItemList list = _itemFactory.makeRow( sheetNode, nullptr );
|
||||
insertRow( newRow, list);
|
||||
}
|
||||
}
|
||||
|
@@ -51,18 +51,16 @@ XQItem* XQMainModel::addProjectItem( XQNodePtr contentNode )
|
||||
|
||||
for(const auto& section : _sections )
|
||||
{
|
||||
|
||||
if( contentNode->attribute( c_ContentType) == section.contentType() )
|
||||
if( contentNode->attribute(c_ContentType) == section.contentType() )
|
||||
{
|
||||
|
||||
qDebug() << " --- add PROJECT: contentNode: " << contentNode->to_string();
|
||||
|
||||
// __fixme! das ist mist!
|
||||
const XQNodePtr sheetNode = section.sheetRootNode()->first_child();
|
||||
XQItemList list = _itemFactory.makeRow( XQItemFactory::mSingle, sheetNode, contentNode, "ProjectName");
|
||||
XQItem* newItem = _itemFactory.makeSingleItem( sheetNode, contentNode->attribute( "ProjectName") );
|
||||
|
||||
// den neuen eintrag in die passende section der übersicht eintragen ...
|
||||
section.headerItem().appendRow( list );
|
||||
section.headerItem().appendRow( newItem );
|
||||
// ... ausklappen...
|
||||
const QModelIndex index = section.headerItem().index();
|
||||
_treeTable->expand( index );
|
||||
@@ -72,30 +70,56 @@ XQItem* XQMainModel::addProjectItem( XQNodePtr contentNode )
|
||||
//newItem->setContentNode( contentNode );
|
||||
//emit itemCreated( newItem );
|
||||
|
||||
XQItem* newItem = dynamic_cast<XQItem*>(list[0]);
|
||||
// erzeuger sheet node speichern
|
||||
newItem->setSheetNode( sheetNode );
|
||||
return newItem;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
throw XQException( "addProjectItem: main model should not be empty!" );
|
||||
}
|
||||
|
||||
void XQMainModel::addSectionItem( const XQModelSection& section, XQItem* projectItem )
|
||||
{
|
||||
qDebug() << " --- SUPPA0: " << section.contentType();
|
||||
qDebug() << " --- SUPPA1: -> " << projectItem->contentNode()->to_string();
|
||||
qDebug() << " --- SUPPA2: -> " << projectItem->sheetNode()->to_string();
|
||||
qDebug() << " --- SUPPA3: -> " << projectItem->sheetNode()->find_child_by_tag_name("CurrentSection")->to_string();
|
||||
|
||||
XQNodePtr sectionChild = projectItem->sheetNode()->find_child_by_tag_name("CurrentSection");
|
||||
|
||||
//qDebug() << " --- SUPPA4: -> " << section.contentRootNode()->to_string();
|
||||
|
||||
return;
|
||||
|
||||
//
|
||||
if(sectionChild)
|
||||
{
|
||||
//XQItemList list = _itemFactory.makeRow( XQItemFactory::mStatic, sectionChild, nullptr, section.contentType() );
|
||||
//projectItem->appendRow( list );
|
||||
_treeTable->expand( projectItem->index() );
|
||||
|
||||
}
|
||||
return;
|
||||
|
||||
for(const auto& xsection : _sections )
|
||||
{
|
||||
|
||||
if( projectItem->contentNode()->attribute(c_ContentType) == xsection.contentType() )
|
||||
{
|
||||
|
||||
//qDebug() << " --- FITZ;: contentNode: " << contentNode->to_string();
|
||||
|
||||
}
|
||||
}
|
||||
// ich brauche _meine_ section für den sheetNode!
|
||||
|
||||
|
||||
/*
|
||||
XQNodePtr sheetNode = projectItem->sheetNode()->find_child_by_tag_name("CurrentSection");
|
||||
XQItemList list = _itemFactory.makeRow( XQItemFactory::mSingle, sheetNode, nullptr, c_ContentType );
|
||||
projectItem->appendRow( list );
|
||||
_treeTable->expand( projectItem->index() );
|
||||
*/
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user