/*************************************************************************** source::worx xtree Copyright © 2024-2025 c.holzheuer christoph.holzheuer@gmail.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include XQMainModel::XQMainModel(QObject *parent ) : XQModel{parent} { } XQMainModel::~XQMainModel() { // delete } 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() ) { qDebug() << " create main model: " << sheetNode->tag_name(); XQItemList list = { _itemFactory.makeHeaderItem( sheetNode ) }; /* Q_ASSERT(!list.isEmpty()); //addSection(list, sheetNode ); */ appendRow( list ); } } XQItem* XQMainModel::createTreeEntry( XQNodePtr contentNode ) { /* for(const auto& section : _sections ) { if( contentNode->attribute("State") == section.sheetRootNode->attribute("State") ) { XQItem* entry = _itemFactory.createTreeItem( contentNode, section.sheetRootNode ); section.headerItem().appendRow( entry ); _treeView->expand( section.modelIndex ); // ?? _treeView->setCurrentIndex( section.modelIndex ); //emit xqItemCreated( entry ); return entry; } } */ return nullptr; } void XQMainModel::initContextMenu() { }