Enable section toggle
This commit is contained in:
@@ -165,9 +165,9 @@ void XQViewModel::addSection(const XQItemList& list, const XQNodePtr& sectionNod
|
||||
// 5. das erzeugt dann auch valide indices
|
||||
appendRow(list);
|
||||
|
||||
const QString §ionKey = sectionNode->attribute(c_ContentType);
|
||||
// 6. jetzt können wir auch die sction erzeugen
|
||||
XQModelSection section(list[0]->index(), sectionNode );
|
||||
_sections.addAtKey(sectionNode->attribute( c_ContentType), section);
|
||||
const XQModelSection& section = _sections.createSection( sectionKey, list[0]->index(), sectionNode );
|
||||
|
||||
// ... und es der welt mitteilen.
|
||||
emit sectionCreated( section );
|
||||
@@ -178,6 +178,8 @@ 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));
|
||||
}
|
||||
|
||||
|
||||
@@ -197,15 +199,6 @@ void XQViewModel::toggleSection( const XQModelSection& section )
|
||||
|
||||
}
|
||||
|
||||
void XQViewModel::toggleSection( const QString& sectionKey )
|
||||
{
|
||||
if( _sections.hasValidSection( sectionKey ) )
|
||||
{
|
||||
XQModelSection& section = _sections.at( sectionKey);
|
||||
//section.
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
//! SLOT als weiterleitung vom SIGNAL itemchanged
|
||||
|
||||
@@ -353,7 +346,7 @@ void XQViewModel::cmdCutUndo( const XQCommand& command )
|
||||
// die anfangsposition
|
||||
int itmPos = command.first().itemPos;
|
||||
// die 'zuständige' section rausfinden
|
||||
const XQModelSection& section = _sections.sectionFromRow( itmPos );
|
||||
const XQModelSection& section = _sections.sectionByRow( itmPos );
|
||||
// über alle einträge ...
|
||||
for (auto& entry : command )
|
||||
{
|
||||
@@ -387,7 +380,7 @@ void XQViewModel::cmdPaste( const XQCommand& command )
|
||||
int nodePos = item.contentNode()->own_pos()+1;
|
||||
|
||||
// die zugehörige section finden
|
||||
const XQModelSection& section = _sections.sectionFromRow( insRow-1 );
|
||||
const XQModelSection& section = _sections.sectionByRow( insRow-1 );
|
||||
// wir pasten das clipboard
|
||||
for (auto& entry : _clipBoard )
|
||||
{
|
||||
@@ -476,7 +469,7 @@ void XQViewModel::cmdNew( const XQCommand& command )
|
||||
|
||||
|
||||
//...
|
||||
const XQModelSection& section = _sections.sectionFromIndex( origin );
|
||||
const XQModelSection& section = _sections.sectionByIndex( origin );
|
||||
|
||||
// neue, leere zeile erzeugen ...
|
||||
XQItemList list =_itemFactory.makeRow( section.sheetRootNode(), newNode );
|
||||
@@ -506,7 +499,7 @@ void XQViewModel::cmdToggleSection( const XQCommand& command )
|
||||
{
|
||||
const QModelIndex& index = command.originIndex();
|
||||
Q_ASSERT(index.isValid());
|
||||
toggleSection( _sections.sectionFromIndex(index) );
|
||||
toggleSection( _sections.sectionByIndex(index) );
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user