Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/DockAreaWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,7 @@ bool CDockAreaWidget::restoreState(CDockingStateReader& s, CDockAreaWidget*& Cre
{
return false;
}
const QString UserCustomProperty = s.attributes().value(internal::UserCustomProperty).toString();

s.skipCurrentElement();
CDockWidget* DockWidget = DockManager->findDockWidget(ObjectName.toString());
Expand All @@ -1068,6 +1069,14 @@ bool CDockAreaWidget::restoreState(CDockingStateReader& s, CDockAreaWidget*& Cre
DockWidget->setClosedState(Closed);
DockWidget->setProperty(internal::ClosedProperty, Closed);
DockWidget->setProperty(internal::DirtyProperty, false);
if (!UserCustomProperty.isEmpty())
{
DockWidget->setProperty(internal::UserCustomProperty, UserCustomProperty);
}
else
{
DockWidget->setProperty(internal::UserCustomProperty, QVariant());
}
}

if (Testing)
Expand Down
5 changes: 5 additions & 0 deletions src/DockWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,11 @@ void CDockWidget::saveState(QXmlStreamWriter& s) const
s.writeStartElement("Widget");
s.writeAttribute("Name", objectName());
s.writeAttribute("Closed", QString::number(d->Closed ? 1 : 0));
QString UserCustomProperty = property(internal::UserCustomProperty).toString();
if (!UserCustomProperty.isEmpty())
{
s.writeAttribute(internal::UserCustomProperty, UserCustomProperty);
}
s.writeEndElement();
}

Expand Down
1 change: 1 addition & 0 deletions src/ads_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ namespace internal
static const bool RestoreTesting = true;
static const bool Restore = false;
static const char* const ClosedProperty = "close";
static const char* const UserCustomProperty = "UserCustomProperty";
static const char* const DirtyProperty = "dirty";
static const char* const LocationProperty = "Location";
extern const int FloatingWidgetDragStartEvent;
Expand Down