mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 07:31:33 +08:00
Fixes crash, if only a single SectionContent elemet has been added to
ContainerWidget, make it floating and drop it back into ContainerWidget.
This commit is contained in:
parent
778192176f
commit
846535c085
@ -690,7 +690,19 @@ SectionWidget* ContainerWidget::dropContentOuterHelper(QLayout* l, const Interna
|
|||||||
sw->addContent(data, true);
|
sw->addContent(data, true);
|
||||||
|
|
||||||
QSplitter* oldsp = findImmediateSplitter(this);
|
QSplitter* oldsp = findImmediateSplitter(this);
|
||||||
if (oldsp->orientation() == orientation
|
if (!oldsp)
|
||||||
|
{
|
||||||
|
QSplitter* sp = newSplitter(orientation);
|
||||||
|
if (l->count() > 0)
|
||||||
|
{
|
||||||
|
qWarning() << "Still items in layout. This should never happen.";
|
||||||
|
QLayoutItem* li = l->takeAt(0);
|
||||||
|
delete li;
|
||||||
|
}
|
||||||
|
l->addWidget(sp);
|
||||||
|
sp->addWidget(sw);
|
||||||
|
}
|
||||||
|
else if (oldsp->orientation() == orientation
|
||||||
|| oldsp->count() == 1)
|
|| oldsp->count() == 1)
|
||||||
{
|
{
|
||||||
oldsp->setOrientation(orientation);
|
oldsp->setOrientation(orientation);
|
||||||
|
Loading…
Reference in New Issue
Block a user