-- semi-fy
This commit is contained in:
@@ -142,6 +142,7 @@ const XQModelSection& XQSectionManager::sectionByRow(int itemRow ) const
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const XQModelSection& XQSectionManager::createSection(const QModelIndex& modelIndex, XQNodePtr sheetNode)
|
const XQModelSection& XQSectionManager::createSection(const QModelIndex& modelIndex, XQNodePtr sheetNode)
|
||||||
{
|
{
|
||||||
const QString& sectionKey = sheetNode->attribute(c_ContentType);
|
const QString& sectionKey = sheetNode->attribute(c_ContentType);
|
||||||
|
@@ -59,6 +59,7 @@ void XQSelectionModel::select(const QItemSelection& selection, QItemSelectionMod
|
|||||||
|
|
||||||
// step 03: selektiere nur knoten, die den gleichen tag_name haben, sich also
|
// step 03: selektiere nur knoten, die den gleichen tag_name haben, sich also
|
||||||
// in der selben section befinden
|
// in der selben section befinden
|
||||||
|
|
||||||
if( firstNode )
|
if( firstNode )
|
||||||
{
|
{
|
||||||
QItemSelection newSelection;
|
QItemSelection newSelection;
|
||||||
@@ -71,5 +72,7 @@ void XQSelectionModel::select(const QItemSelection& selection, QItemSelectionMod
|
|||||||
}
|
}
|
||||||
return QItemSelectionModel::select(newSelection, command);
|
return QItemSelectionModel::select(newSelection, command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fallback
|
||||||
QItemSelectionModel::select(selection, command);
|
QItemSelectionModel::select(selection, command);
|
||||||
}
|
}
|
||||||
|
@@ -345,7 +345,8 @@ void XQViewModel::cmdCut( const XQCommand& command )
|
|||||||
const XQNodeBackup& entry = *it;
|
const XQNodeBackup& entry = *it;
|
||||||
|
|
||||||
XQItem& firstItem = xqFirstItem( (*it).itemPos );
|
XQItem& firstItem = xqFirstItem( (*it).itemPos );
|
||||||
qDebug() << " --- Cut: " << firstItem.text() << " " << firstItem.row() << " id#" << entry.contentNode->_id;
|
//qDebug() << " --- Cut: " << firstItem.text() << " " << firstItem.row() << " id#" << entry.contentNode->_id;
|
||||||
|
qDebug() << " ---- command CUT: itemPos: " << entry.itemPos << " nodePos: "<< entry.nodePos << " is " << entry.contentNode->friendly_name();
|
||||||
|
|
||||||
entry.contentNode->unlink_self();
|
entry.contentNode->unlink_self();
|
||||||
removeRow(entry.itemPos );
|
removeRow(entry.itemPos );
|
||||||
@@ -357,10 +358,14 @@ void XQViewModel::cmdCut( const XQCommand& command )
|
|||||||
|
|
||||||
void XQViewModel::cmdCutUndo( const XQCommand& command )
|
void XQViewModel::cmdCutUndo( const XQCommand& command )
|
||||||
{
|
{
|
||||||
|
|
||||||
// die anfangsposition
|
// die anfangsposition
|
||||||
int itmPos = command.first().itemPos;
|
int itmPos = command.first().itemPos;
|
||||||
// die 'zuständige' section rausfinden
|
// die 'zuständige' section rausfinden
|
||||||
const XQModelSection& section = _sections.sectionByRow( itmPos );
|
const XQModelSection& section = _sections.sectionByRow( itmPos );
|
||||||
|
|
||||||
|
qDebug() << " --- HEADSHOT: " << itmPos << "->" << section.contentType();
|
||||||
|
|
||||||
// über alle einträge ...
|
// über alle einträge ...
|
||||||
for (auto& entry : command )
|
for (auto& entry : command )
|
||||||
{
|
{
|
||||||
@@ -368,11 +373,13 @@ void XQViewModel::cmdCutUndo( const XQCommand& command )
|
|||||||
// __fix! should not be _contentRoot!
|
// __fix! should not be _contentRoot!
|
||||||
savedNode->add_me_at( entry.nodePos, _contentRoot );
|
savedNode->add_me_at( entry.nodePos, _contentRoot );
|
||||||
XQItemList list = _itemFactory.makeRow( section.sheetRootNode(), savedNode );
|
XQItemList list = _itemFactory.makeRow( section.sheetRootNode(), savedNode );
|
||||||
|
insertRow( entry.itemPos, list );
|
||||||
|
|
||||||
XQItem& firstItem = *((XQItem*)list[0]);
|
XQItem& firstItem = *((XQItem*)list[0]);
|
||||||
|
|
||||||
|
qDebug() << " ---- command cut UNDO2: itemPos: " << entry.itemPos << " nodePos: "<< entry.nodePos << " is " << entry.contentNode->friendly_name();
|
||||||
qDebug() << " --- Cut Undo: " << firstItem.text() << " " << firstItem.row() << " id#" << entry.contentNode->_id << " count: " << entry.contentNode.use_count();
|
qDebug() << " --- Cut Undo: " << firstItem.text() << " " << firstItem.row() << " id#" << entry.contentNode->_id << " count: " << entry.contentNode.use_count();
|
||||||
|
|
||||||
insertRow( entry.itemPos, list );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Components>
|
<Components>
|
||||||
<Panel FriendlyName="@PanelName" Height="2,70" Manufacturer="JA Solar 1 XX" MaxAmpere="11" MaxVolt="67" PanelID="#1 JA 01" PanelName="JA 01 Solar T62B" WattPeak="620" Weight="12" Width="1,10"/>
|
<Panel FriendlyName="@PanelName" Height="2,70" Manufacturer="JA Solar 1 XX" MaxAmpere="11" MaxVolt="67" PanelID="#1 JA 01" PanelName="JA 01 Solar T62B" WattPeak="620" Weight="12" Width="1,10"/>
|
||||||
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 2" MaxAmpere="11" MaxVolt="42" PanelID="#2 JA 02" PanelName="maa" WattPeak="440" Weight="12" Width="1,10"/>
|
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 2" MaxAmpere="11" MaxVolt="42" PanelID="#2 JA 02" PanelName="JA 02 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/>
|
||||||
<Panel FriendlyName="@PanelName" Height="2,70" Manufacturer="JA Solar 3" MaxAmpere="11" MaxVolt="67" PanelID="#3 JA 03" PanelName="JA 03 Solar T62B" WattPeak="620" Weight="12" Width="1,10"/>
|
<Panel FriendlyName="@PanelName" Height="2,70" Manufacturer="JA Solar 3" MaxAmpere="11" MaxVolt="67" PanelID="#3 JA 03" PanelName="JA 03 Solar T62B" WattPeak="620" Weight="12" Width="1,10"/>
|
||||||
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 4" MaxAmpere="11" MaxVolt="42" PanelID="#4 JA 04" PanelName="moo" WattPeak="440" Weight="12" Width="1,10"/>
|
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 4" MaxAmpere="11" MaxVolt="42" PanelID="#4 JA 04" PanelName="JA 04 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/>
|
||||||
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 5" MaxAmpere="11" MaxVolt="42" PanelID="#5 JA 05" PanelName="JA 05 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/>
|
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 5" MaxAmpere="11" MaxVolt="42" PanelID="#5 JA 05" PanelName="JA 05 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/>
|
||||||
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 6" MaxAmpere="11" MaxVolt="42" PanelID="#6 JA 06" PanelName="JA 06 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/>
|
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 6" MaxAmpere="11" MaxVolt="42" PanelID="#6 JA 06" PanelName="JA 06 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/>
|
||||||
<Inverter FriendlyName="@InverterName" InverterID="#1 HM600 01" InverterName="01 HM600 S2 TMax" Manufacturer="HoyMiles" MaxPowerInput="2000" MaxPowerInputChoice="2000;4000;6000" MaxPowerOutput="600" NumStrings="2" Weight="28"/>
|
<Inverter FriendlyName="@InverterName" InverterID="#1 HM600 01" InverterName="01 HM600 S2 TMax" Manufacturer="HoyMiles" MaxPowerInput="2000" MaxPowerInputChoice="2000;4000;6000" MaxPowerOutput="600" NumStrings="2" Weight="28"/>
|
||||||
|
Reference in New Issue
Block a user