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:
mfreiholz 2016-02-23 09:30:17 +01:00
parent 778192176f
commit 846535c085

View File

@ -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);