mini sucess

This commit is contained in:
2025-08-12 23:41:36 +02:00
parent 756ec3f1fc
commit 7c267bcb33
8 changed files with 109 additions and 48 deletions

View File

@@ -24,6 +24,10 @@
const QString c_Version = "0.1.1 04.09.2024";
const QString c_ItemType = "ItemType";
const QString c_Caption = "Caption";
const QString c_Header = "Header";
const QString c_MainModelName = "DocumentTreeModel";
const QString c_ChildModelName = "DocumentDetailsModel";
const QString c_ProjectID = "ProjectID";

View File

@@ -38,17 +38,22 @@ XQMainModel::XQMainModel(QObject *parent )
void XQMainModel::initModel(const QString& modelName)
{
XQNodePtr modelSheet = _itemFactory.findModelSheet( modelName );
// #1: create structure: create static sections for this model
for( auto& sheetNode : modelSheet->children() )
// model rootnode finden -> <ModelX>
XQNodePtr modelSheet = _itemFactory.findModelSheet( modelName ); // throws
// #1: über alle sections
for( auto& section : modelSheet->children() )
{
qDebug() << " create main model: " << sheetNode->tag_name();
// #2: (optionalen) header erzeugen
const XQNodePtr header = section->find_child_by_tag_name( "Header");
if( header )
{
XQItemList list = _itemFactory.makeHeader( header );
Q_ASSERT(!list.isEmpty());
addSection(list, section );
}
XQItemList list = { _itemFactory.makeHeaderItem( sheetNode ) };
Q_ASSERT(!list.isEmpty());
addSection(list, sheetNode );
//appendRow( list );
}
}

View File

@@ -85,10 +85,11 @@ void XQMainWindow::initMainWindow()
// hand over left side navigation tree
_mainModelView.setTreeTable(_mainTreeView);
// #1. init the left side main tree view
_mainModelView.initModel( c_MainModelName );
//_mainModelView.initModel( c_MainModelName );
_mainModelView.initModel( "ModelX" );
// #2. load demo data
loadDocument( c_DocumentFileName1 );
//loadDocument( c_DocumentFileName1 );
//loadDocument( c_DocumentFileName2 );
qDebug() << " --- all here: " << XQNode::s_Count;