Skip to content

Commit ce15e7e

Browse files
author
morb_au
committedJul 19, 2006
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/qgis@5611 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 8fd8143 commit ce15e7e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed
 

‎src/composer/qgscomposer.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,17 @@ void QgsComposer::removeWidgetChildren ( QWidget *w )
140140
if( ob->isWidgetType() )
141141
{
142142
QWidget *ow = (QWidget *) ob;
143-
w->removeChild ( ob );
144-
ow->hide ();
143+
144+
// The following line is legacy Qt3, is not supported in Qt4
145+
// and can cause a SIGABRT
146+
//w->removeChild ( ob );
147+
// instead:
148+
ow->setParent(0);
149+
// TODO: Eventually mItemOptionsFrame should be made
150+
// a Qt4 QStackedWidget and all this removeWidgetChildren
151+
// shenanigans can alledgedly go away
152+
153+
ow->hide();
145154
}
146155
}
147156
}

0 commit comments

Comments
 (0)
Please sign in to comment.