mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 13:15:43 +08:00
Use takeContents() for strict ownership switch.
This commit is contained in:
parent
8914904dba
commit
1b91fe241b
@ -560,11 +560,20 @@ bool ContainerWidget::restoreSectionWidgets(QDataStream& in, QSplitter* currentS
|
|||||||
SectionWidget* sw = new SectionWidget(this);
|
SectionWidget* sw = new SectionWidget(this);
|
||||||
for (int i = 0; i < count; ++i)
|
for (int i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
QString name;
|
QString uname;
|
||||||
in >> name;
|
in >> uname;
|
||||||
const SectionContent::RefPtr sc = SectionContent::LookupMapByName.value(name).toStrongRef();
|
const SectionContent::RefPtr sc = SectionContent::LookupMapByName.value(uname).toStrongRef();
|
||||||
if (sc)
|
if (!sc)
|
||||||
sw->addContent(sc);
|
{
|
||||||
|
qWarning() << "Can not find SectionContent:" << uname;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
InternalContentData data;
|
||||||
|
if (!this->takeContent(sc, data))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
sw->addContent(sc);
|
||||||
}
|
}
|
||||||
sw->setCurrentIndex(currentIndex);
|
sw->setCurrentIndex(currentIndex);
|
||||||
currentSplitter->addWidget(sw);
|
currentSplitter->addWidget(sw);
|
||||||
|
Loading…
Reference in New Issue
Block a user