Changed store and restore functioality to save the current dock widget name of an dock area instead of the current index because if some dock widgets are missing when loading the configuration, the dock index might be wrong
This commit is contained in:
@@ -526,13 +526,14 @@ bool DockContainerWidgetPrivate::restoreDockArea(QXmlStreamReader& s,
|
||||
return false;
|
||||
}
|
||||
|
||||
int CurrentIndex = s.attributes().value("CurrentIndex").toInt(&Ok);
|
||||
if (!Ok)
|
||||
|
||||
QString CurrentDockWidget = s.attributes().value("CurrentDockWidget").toString();
|
||||
if (CurrentDockWidget.isEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
qDebug() << "Restore NodeDockArea Tabs: " << Tabs << " CurrentIndex: "
|
||||
<< CurrentIndex;
|
||||
qDebug() << "Restore NodeDockArea Tabs: " << Tabs << " CurrentDockWidget: "
|
||||
<< CurrentDockWidget;
|
||||
|
||||
CDockAreaWidget* DockArea = nullptr;
|
||||
if (!Testing)
|
||||
@@ -590,7 +591,7 @@ bool DockContainerWidgetPrivate::restoreDockArea(QXmlStreamReader& s,
|
||||
}
|
||||
else
|
||||
{
|
||||
DockArea->setProperty("currentIndex", CurrentIndex);
|
||||
DockArea->setProperty("currentDockWidget", CurrentDockWidget);
|
||||
DockAreas.append(DockArea);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user