mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Fix an Q_ASSERT failure in the Print Composer when "Adding new vect legend" and then clicking it into place on the composer canvas.
This appears to be because of the use of QWidget::removeChild in QgsComposer::removeWidgetChildren, which is a Qt3 idiom (it doesn't appear in the Qt4.1 API). A QWidget::setParent(0) idiom is now used instead. git-svn-id: http://svn.osgeo.org/qgis/trunk@5611 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
269d4ef559
commit
264a408c91
@ -140,8 +140,17 @@ void QgsComposer::removeWidgetChildren ( QWidget *w )
|
||||
if( ob->isWidgetType() )
|
||||
{
|
||||
QWidget *ow = (QWidget *) ob;
|
||||
w->removeChild ( ob );
|
||||
ow->hide ();
|
||||
|
||||
// The following line is legacy Qt3, is not supported in Qt4
|
||||
// and can cause a SIGABRT
|
||||
//w->removeChild ( ob );
|
||||
// instead:
|
||||
ow->setParent(0);
|
||||
// TODO: Eventually mItemOptionsFrame should be made
|
||||
// a Qt4 QStackedWidget and all this removeWidgetChildren
|
||||
// shenanigans can alledgedly go away
|
||||
|
||||
ow->hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user