This commit is contained in:
2025-09-05 17:12:38 +02:00
parent 9c6f7688d7
commit b8f0893d59
6 changed files with 53 additions and 51 deletions

View File

@@ -178,27 +178,21 @@ void XQViewModel::addSection(const XQItemList& list, const XQNodePtr& sectionNod
void XQViewModel::onToggleSection(const QString& sectionKey )
{
qDebug() << " --- onToggleSection: " << sectionKey;
if( _sections.hasValidSection( sectionKey ) )
toggleSection( _sections.sectionByKey(sectionKey));
}
void XQViewModel::toggleSection( const XQModelSection& section )
{
if(_treeTable)
if( _sections.hasValidSection( sectionKey ) && _treeTable )
{
const QModelIndex& index = section.persistentModelIndex();
qDebug() << " ---- toggle section: FIRZ: " << index.isValid() << " : " << index.data().toString() << " : " << section.contentType();//_sections.keyOf( sec );
int fstRow = _sections.firstRow( index );
int lstRow = _sections.lastRow( index );
_treeTable->toggleRowsHidden(fstRow, lstRow );
emit sectionToggled( section );
//const XQModelSection& section =_sections.sectionByKey(sectionKey);
//int fstRow = _sections.firstRow(index);
//int lstRow = _sections.lastRow(index);
//_treeTable->toggleRowsHidden(fstRow, lstRow);
//emit sectionToggled(section);
}
emit sectionToggled( section );
}
/*
//! SLOT als weiterleitung vom SIGNAL itemchanged
@@ -495,13 +489,14 @@ void XQViewModel::cmdNewUndo( const XQCommand& command )
//! schaltet eine section sichtbar oder unsichtbar.
/*
void XQViewModel::cmdToggleSection( const XQCommand& command )
{
const QModelIndex& index = command.originIndex();
Q_ASSERT(index.isValid());
toggleSection( _sections.sectionByIndex(index) );
}
*/
//! gibt die treetable zurück