-- backup

This commit is contained in:
2025-08-22 17:52:08 +02:00
parent b6299be24b
commit e3be14c27b
5 changed files with 22 additions and 26 deletions

View File

@@ -48,7 +48,6 @@ XQItem* XQMainModel::addProjectItem( XQNodePtr contentNode )
// wir durchsuchen alle unsere section nach dem passenden content-type,
// hier: content-type beschreibt die
/*
for(const auto& section : _sections )
{
@@ -57,12 +56,12 @@ XQItem* XQMainModel::addProjectItem( XQNodePtr contentNode )
const QString* contentPtr = contentNode->attribute_ptr( "ProjectName" );
// __fixme! das ist mist!
const XQNodePtr sheetNode = section.sheetRootNode()->first_child();
XQItem* newItem = _itemFactory.makeItem(sheetNode, contentPtr );
XQItemList list = _itemFactory.makeHeaderRow( sheetNode, contentPtr );
// erzeuger sheet node speichern
newItem->setSheetNode( sheetNode );
//newItem->setSheetNode( sheetNode );
// den neuen eintrag in die passende section der übersicht eintragen ...
section.headerItem().appendRow( newItem );
section.headerItem().appendRow( list );
// ... ausklappen...
const QModelIndex index = section.headerItem().index();
_treeTable->expand( index );
@@ -72,13 +71,12 @@ XQItem* XQMainModel::addProjectItem( XQNodePtr contentNode )
//newItem->setContentNode( contentNode );
//emit itemCreated( newItem );
return newItem;
return list[0];
}
}
*/
.
throw XQException( "addProjectItem: main model should not be empty!" );
}

View File

@@ -259,20 +259,18 @@ void XQMainWindow::onTreeItemClicked(const QModelIndex& index )
qDebug() << " --- XXX mainWindow onTreeItemClicked:" << entry.text();
_mainTreeView->selectionModel()->select(index, QItemSelectionModel::Select);
//entry.setBackground( QBrush( Qt::green ) );
QVariant variant = entry.QStandardItem::data( XQItem::ContentNodeRole );
if( XQNodePtr contentNode = entry.contentNode() )
{
QString key = contentNode->attribute(c_ProjectID);
qDebug() << " --- FIRZ: key: " << key;
XQNodePtr ptr = variant.value<XQNodePtr>();
bool isThere = _documentStore.contains(key);
if( isThere)
_tabWidget->setCurrentWidget( _documentStore[key].modelView->treeTable() );
}
/*
QString key = entry.attribute(c_ProjectID);
qDebug() << " --- FIRZ: key: " << key;
bool isThere = _documentStore.contains(key);
if( isThere)
_tabWidget->setCurrentWidget( _documentStore[key].modelView->treeTable() );
*/
}

View File

@@ -306,14 +306,14 @@ XQItemList XQItemFactory::createGenericRow( const XQNodePtr& contentNode, const
//! erzeugt eine header-item row.
XQItemList XQItemFactory::makeHeaderRow( const XQNodePtr& sheetNode )
XQItemList XQItemFactory::makeHeaderRow( const XQNodePtr& sheetNode, const QString& caption )
{
XQItemList list;
for( const auto& sheetEntry : sheetNode->children() )
{
list.append( makeHeaderItem( sheetEntry ) );
list.append( makeHeaderItem( sheetEntry, caption ) );
}
Q_ASSERT(!list.empty());
@@ -354,7 +354,7 @@ XQItemList XQItemFactory::makeContentRow( const XQNodePtr& sheetNode, const XQNo
}
XQItem* XQItemFactory::makeHeaderItem( const XQNodePtr& sheetNode )
XQItem* XQItemFactory::makeHeaderItem( const XQNodePtr& sheetNode, const QString& caption )
{
// den itemtype des neuen items rausfinden
XQItemType* itemType = makeItemType(sheetNode); // throws
@@ -362,7 +362,7 @@ XQItem* XQItemFactory::makeHeaderItem( const XQNodePtr& sheetNode )
// das ist Unterschied zum normalen Item: Der Titel kommt aus der Modelbeschreibung
// der content wird indirect über den tag-name des sheetnode geholt
XQItem* newItem = new XQItem( itemType, sheetNode->attribute_ptr(c_Caption) );
XQItem* newItem = new XQItem( itemType, sheetNode->attribute_ptr(caption) );
// __fixme!
if( newItem->isCheckable() )

View File

@@ -34,7 +34,7 @@ public:
//XQItemList makeEmptyRow( const XQNodePtr& contentNode, const XQNodePtr& sheetNode );
XQItemList makeHeaderRow( const XQNodePtr& sheetNode );
XQItemList makeHeaderRow( const XQNodePtr& sheetNode, const QString& caption = c_Caption );
XQItemList makeContentRow( const XQNodePtr& sheetNode, const XQNodePtr& contentNode );
// wozu ist das gut?
@@ -50,7 +50,7 @@ protected:
bool isValid();
XQItem* makeHeaderItem( const XQNodePtr& sheetNode );
XQItem* makeHeaderItem( const XQNodePtr& sheetNode, const QString& caption );
XQItem* makeContentItem( const XQNodePtr& sheetNode, const XQNodePtr& contentNode );
XQItem* makeItem( const XQNodePtr& sheetNode, const XQNodePtr& contentNode );

View File

@@ -117,9 +117,9 @@ protected:
using MemCallMap = QMap<XQCommand::CmdType,MemCall>;
// das eine reference auf ein globales singleton
XQItemFactory& _itemFactory;
XQSimpleClipBoard _clipBoard;
XQModelSectionList _sections;
XQItemFactory& _itemFactory;
XQSimpleClipBoard _clipBoard;
XQModelSectionList _sections;
XQTreeTable* _treeTable{};
//QAbstractItemView* _treeTable{};