/*************************************************************************** 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 //! default konstruktor. XQMainModel::XQMainModel(QObject *parent ) : XQViewModel{parent} { } //! leere default implementation void XQMainModel::initContextMenu() { } //! erzeugt einen eintrag in der baum-übersicht. XQItem* XQMainModel::createTreeEntry( XQNodePtr contentNode ) { for(const auto& section : _sections ) { qDebug() << " --- wtf1: " << contentNode->to_string(); qDebug() << " --- wtf2: " << section.sheetRootNode()->to_string(); /* if( contentNode->attribute("State") == section.sheetRootNode->attribute("State") ) { //XQItem* newTreeentry = _itemFactory.makeTreeChildItem( contentNode, section.sheetRootNode ); makeTreeChildItem: // den itemtype des neuen items rausfinden QString typeKey = sheetEntry->attribute("ItemType"); XQItemType* itemType = findItemTypeTemplate(typeKey); // throws //XQItemType* itemType = makeItemType(sheetEntry); // throws const QString* contentPtr = contentNode->attribute_ptr( "ProjectName" ); XQItem* newItem = new XQItem( itemType, contentPtr ); return newItem; section.headerItem().appendRow( newTreeentry ); _treeTable->expand( section.modelIndex ); // ?? _treeTable->setCurrentIndex( section.modelIndex ); newTreeentry->setContentNode(contentNode); emit xqItemCreated( newTreeentry ); return newTreeentry; } */ } throw XQException( "createTreeEntry: main model should not be empty!" ); }