Fixed toggleSection
This commit is contained in:
@@ -320,7 +320,7 @@ void XQMainWindow::onSectionCreated( const XQModelSection& section )
|
|||||||
|
|
||||||
void XQMainWindow::onSectionToggled( const XQModelSection& section )
|
void XQMainWindow::onSectionToggled( const XQModelSection& section )
|
||||||
{
|
{
|
||||||
//qDebug() << " --- XXX section toggled: " << section.contentType() << ":" << section.sheetRootNode()->to_string();
|
qDebug() << " --- XXX section toggled: " << section.contentType() << ":" << section.sheetRootNode()->to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
void XQMainWindow::setChildTabByName( const QString& key )
|
void XQMainWindow::setChildTabByName( const QString& key )
|
||||||
|
@@ -172,9 +172,9 @@ int XQSectionManager::lastRow(const XQModelSection& section ) const
|
|||||||
{
|
{
|
||||||
// last section? return last row of model
|
// last section? return last row of model
|
||||||
if (index == _sections.size() - 1)
|
if (index == _sections.size() - 1)
|
||||||
return section.startIndex().model()->rowCount() - 1;
|
return section.startIndex().model()->rowCount();// - 1;
|
||||||
// return row above the row of the next section -> last row of given section
|
// return row above the row of the next section -> last row of given section
|
||||||
return _sections.at(index+1).firstRow() - 1;
|
return _sections.at(index+1).firstRow();// - 1;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@@ -152,22 +152,22 @@ void XQViewModel::initModel(const QString& modelName)
|
|||||||
//! Wrzeugt dann eine section aus einer frisch erzeugten itemlist. Der erste modelindex
|
//! Wrzeugt dann eine section aus einer frisch erzeugten itemlist. Der erste modelindex
|
||||||
//! der liste und der root knoten der model-beschreibung werden gespeichert.
|
//! der liste und der root knoten der model-beschreibung werden gespeichert.
|
||||||
|
|
||||||
void XQViewModel::addSection(const XQItemList& list, const XQNodePtr& sectionNode )
|
void XQViewModel::addSection(const XQItemList& list, const XQNodePtr& sheetNode )
|
||||||
{
|
{
|
||||||
// 1. die liste darf nicht leer sein
|
// 1. die liste darf nicht leer sein
|
||||||
Q_ASSERT(!list.isEmpty());
|
Q_ASSERT(!list.isEmpty());
|
||||||
// 2. sectionNode muss da sein
|
// 2. sheetNode muss da sein
|
||||||
Q_ASSERT(sectionNode);
|
Q_ASSERT(sheetNode);
|
||||||
// 3. 'ContenType' muss vorhanden sein
|
// 3. 'ContenType' muss vorhanden sein
|
||||||
if( !sectionNode->has_attribute( c_ContentType) )
|
if( !sheetNode->has_attribute( c_ContentType) )
|
||||||
throw XQException( "section list: Section node needs attribute 'ContentType'!");
|
throw XQException( "section list: Section node needs attribute 'ContentType'!");
|
||||||
|
|
||||||
// 5. das erzeugt dann auch valide indices
|
// 5. das erzeugt dann auch valide indices
|
||||||
appendRow(list);
|
appendRow(list);
|
||||||
|
|
||||||
const QString §ionKey = sectionNode->attribute(c_ContentType);
|
const QString §ionKey = sheetNode->attribute(c_ContentType);
|
||||||
// 6. jetzt können wir auch die sction erzeugen
|
// 6. jetzt können wir auch die sction erzeugen
|
||||||
const XQModelSection& section = _sections.createSection( sectionKey, list[0]->index(), sectionNode );
|
const XQModelSection& section = _sections.createSection( sectionKey, list[0]->index(), sheetNode );
|
||||||
|
|
||||||
// ... und es der welt mitteilen.
|
// ... und es der welt mitteilen.
|
||||||
emit sectionCreated( section );
|
emit sectionCreated( section );
|
||||||
@@ -193,10 +193,11 @@ void XQViewModel::toggleSection( const XQModelSection& section )
|
|||||||
XQSectionRange pos = _sections.sectionRange(section);
|
XQSectionRange pos = _sections.sectionRange(section);
|
||||||
//int fstRow = _sections.firstRow(index);
|
//int fstRow = _sections.firstRow(index);
|
||||||
//int lstRow = _sections.lastRow(index);
|
//int lstRow = _sections.lastRow(index);
|
||||||
//_treeTable->toggleRowsHidden(fstRow, lstRow);
|
_treeTable->toggleRowsHidden(pos.firstRow, pos.lastRow );
|
||||||
|
qDebug() << " --- toggleSection: " << section.contentType();
|
||||||
|
|
||||||
// hier nicht!?
|
// hier nicht!?
|
||||||
//emit sectionToggled(section);
|
emit sectionToggled(section);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -441,7 +442,7 @@ void XQViewModel::cmdDelete( const XQCommand& command )
|
|||||||
// ... holen das erste item, das auch den content node enthält
|
// ... holen das erste item, das auch den content node enthält
|
||||||
const XQNodeBackup& entry = *it;
|
const XQNodeBackup& entry = *it;
|
||||||
XQItem& firstItem = xqFirstItem( (*it).itemPos );
|
XQItem& firstItem = xqFirstItem( (*it).itemPos );
|
||||||
qDebug() << " --- Cut: " << firstItem.text() << " " << firstItem.row();
|
qDebug() << " --- delete: " << firstItem.text() << " " << firstItem.row();
|
||||||
// jetzt löschen
|
// jetzt löschen
|
||||||
entry.contentNode->unlink_self();
|
entry.contentNode->unlink_self();
|
||||||
removeRow(entry.itemPos );
|
removeRow(entry.itemPos );
|
||||||
@@ -452,7 +453,10 @@ void XQViewModel::cmdDelete( const XQCommand& command )
|
|||||||
|
|
||||||
void XQViewModel::cmdDeleteUndo( const XQCommand& command )
|
void XQViewModel::cmdDeleteUndo( const XQCommand& command )
|
||||||
{
|
{
|
||||||
|
for (const auto& entry : command)
|
||||||
|
{
|
||||||
|
qDebug() << " --- delete UNDo: " << entry.contentNode->to_string();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -2,6 +2,7 @@ QT += core gui widgets quick quickwidgets
|
|||||||
# widgets-private
|
# widgets-private
|
||||||
|
|
||||||
CONFIG += c++20 qmltypes
|
CONFIG += c++20 qmltypes
|
||||||
|
CONFIG -= qml_debug
|
||||||
|
|
||||||
QML_IMPORT_NAME = org.sourceworx.qmlcomponents
|
QML_IMPORT_NAME = org.sourceworx.qmlcomponents
|
||||||
QML_IMPORT_MAJOR_VERSION = 1
|
QML_IMPORT_MAJOR_VERSION = 1
|
||||||
|
@@ -4,9 +4,9 @@
|
|||||||
<Project ProjectID="HA02" FriendlyName="@ProjectName" ProjectName="Gerbrunn Ost" Established="2006" WattPeak="9840" ContentType="planned">
|
<Project ProjectID="HA02" FriendlyName="@ProjectName" ProjectName="Gerbrunn Ost" Established="2006" WattPeak="9840" ContentType="planned">
|
||||||
<Components>
|
<Components>
|
||||||
<Panel PanelID="Jingli 01" FriendlyName="@PanelName" PanelName="Jingli 01 Solar T62B" Manufacturer="Jingli Solar" WattPeak="620" Height="2,70" Width="1,10" Weight="12" MaxVolt="67" MaxAmpere="11">
|
<Panel PanelID="Jingli 01" FriendlyName="@PanelName" PanelName="Jingli 01 Solar T62B" Manufacturer="Jingli Solar" WattPeak="620" Height="2,70" Width="1,10" Weight="12" MaxVolt="67" MaxAmpere="11">
|
||||||
<AdditionalData DataItem="Image" DataValue="image,png"/>
|
<AdditionalData DataItem="Image" DataValue="image.png"/>
|
||||||
<AdditionalData DataItem="Manual" DataValue="manual,docx"/>
|
<AdditionalData DataItem="Manual" DataValue="manual.docx"/>
|
||||||
<AdditionalData DataItem="Certificate" DataValue="certificate,pdf"/>
|
<AdditionalData DataItem="Certificate" DataValue="certificate.pdf"/>
|
||||||
</Panel>
|
</Panel>
|
||||||
<Panel PanelID="Jingli 02" FriendlyName="@PanelName" PanelName="Jingli 02 Solar X58C" Manufacturer="Jingli Solar" WattPeak="440" Height="1,70" Width="1,10" Weight="12" MaxVolt="42" MaxAmpere="11"/>
|
<Panel PanelID="Jingli 02" FriendlyName="@PanelName" PanelName="Jingli 02 Solar X58C" Manufacturer="Jingli Solar" WattPeak="440" Height="1,70" Width="1,10" Weight="12" MaxVolt="42" MaxAmpere="11"/>
|
||||||
<Panel PanelID="Jingli 03" FriendlyName="@PanelName" PanelName="Jingli 03 Solar T62B" Manufacturer="Jingli Solar" WattPeak="620" Height="2,70" Width="1,10" Weight="12" MaxVolt="67" MaxAmpere="11"/>
|
<Panel PanelID="Jingli 03" FriendlyName="@PanelName" PanelName="Jingli 03 Solar T62B" Manufacturer="Jingli Solar" WattPeak="620" Height="2,70" Width="1,10" Weight="12" MaxVolt="67" MaxAmpere="11"/>
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
|
||||||
<Project ProjectID="HA03" FriendlyName="@ProjectName" ProjectName="Neubrunn Süd" Established="2006" WattPeak="9840" ContentType="runnning">
|
<Project ProjectID="HA03" FriendlyName="@ProjectName" ProjectName="Tauberbischoffsheim SÜD" Established="2006" WattPeak="9840" ContentType="runnning">
|
||||||
<Components>
|
<Components>
|
||||||
<Panel PanelID="AIKO 01" FriendlyName="@PanelName" PanelName="AIKO 01 Solar T62B" Manufacturer="AIKO Solar" WattPeak="620" Height="2,70" Width="1,10" Weight="12" MaxVolt="67" MaxAmpere="11">
|
<Panel PanelID="AIKO 01" FriendlyName="@PanelName" PanelName="AIKO 01 Solar T62B" Manufacturer="AIKO Solar" WattPeak="620" Height="2,70" Width="1,10" Weight="12" MaxVolt="67" MaxAmpere="11">
|
||||||
<AdditionalData DataItem="Image" DataValue="image.png"/>
|
<AdditionalData DataItem="Image" DataValue="image.png"/>
|
||||||
|
Reference in New Issue
Block a user