mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 21:25:44 +08:00
Fixed serialization and deserialization of splitter orientation: | means Horizontal and - means vertical - ATTENTION: this breaks backward compatibility with old saved states
This commit is contained in:
parent
b353c210ee
commit
316d9a00b5
@ -555,7 +555,7 @@ void DockContainerWidgetPrivate::saveChildNodesState(QXmlStreamWriter& s, QWidge
|
||||
if (Splitter)
|
||||
{
|
||||
s.writeStartElement("Splitter");
|
||||
s.writeAttribute("Orientation", (Splitter->orientation() == Qt::Horizontal) ? "-" : "|");
|
||||
s.writeAttribute("Orientation", (Splitter->orientation() == Qt::Horizontal) ? "|" : "-");
|
||||
s.writeAttribute("Count", QString::number(Splitter->count()));
|
||||
ADS_PRINT("NodeSplitter orient: " << Splitter->orientation()
|
||||
<< " WidgetCont: " << Splitter->count());
|
||||
@ -590,11 +590,11 @@ bool DockContainerWidgetPrivate::restoreSplitter(QXmlStreamReader& s,
|
||||
bool Ok;
|
||||
QString OrientationStr = s.attributes().value("Orientation").toString();
|
||||
int Orientation;
|
||||
if (OrientationStr.startsWith("-"))
|
||||
if (OrientationStr.startsWith("|"))
|
||||
{
|
||||
Orientation = Qt::Horizontal;
|
||||
}
|
||||
else if (OrientationStr.startsWith("|"))
|
||||
else if (OrientationStr.startsWith("-"))
|
||||
{
|
||||
Orientation = Qt::Vertical;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user