trashed it.

This commit is contained in:
2025-08-20 23:04:09 +02:00
parent 0ec1f7a7c0
commit 306a68f6c9
4 changed files with 62 additions and 16 deletions

View File

@@ -303,6 +303,25 @@ XQItemList XQItemFactory::createGenericRow( const XQNodePtr& contentNode, const
*/
//! erzeugt eine header-item row.
XQItemList XQItemFactory::makeHeaderRow( const XQNodePtr& sheetNode )
{
XQItemList list;
for( const auto& sheetEntry : sheetNode->children() )
{
list.append( makeHeaderItem( sheetEntry ) );
}
Q_ASSERT(!list.empty());
return list;
}
//! erzeugt eine item-row.
XQItemList XQItemFactory::makeContentRow( const XQNodePtr& sheetNode, const XQNodePtr& contentNode )
@@ -321,20 +340,37 @@ XQItemList XQItemFactory::makeContentRow( const XQNodePtr& sheetNode, const XQNo
//
for( const auto& sheetEntry : sheetNode->children() )
{
list.append( makeItem( sheetEntry, contentNode ) );
{
list.append( makeContentItem( sheetEntry, contentNode ) );
}
if( !list.empty() )
{
// wir merken uns den original content node auch, aber
// im ersten Item.
dynamic_cast<XQItem*>(list[0])->setContentNode(contentNode);
}
Q_ASSERT(!list.empty());
// wir merken uns den original content node auch, aber
// im ersten Item.
dynamic_cast<XQItem*>(list[0])->setContentNode(contentNode);
return list;
}
XQItem* XQItemFactory::makeHeaderItem( const XQNodePtr& sheetNode )
{
// den itemtype des neuen items rausfinden
XQItemType* itemType = makeItemType(sheetNode); // throws
// 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) );
// __fixme!
if( newItem->isCheckable() )
newItem->setCheckState( Qt::Checked );
return newItem;
}
//! fixme! unsinn!
//! erzeugt ein XQItem aus einer typ-beschreibung ('sheetNode') und einem daten-knoten ('contentNode').
//! wenn der content node nicht gesetzt ist, wird stattdess das attribut 'Caption' aus der typ-beschreibung