Skip to content
Permalink
Browse files

Fix logic in QgsUserInputWidget which incorrectly deletes other

widgets whenever one existing widget is deleted

Fixes calls to iface.addUserInputWidget() does not show any widget if
an existing user input widget is already shown

(cherry picked from commit d8351c0)
  • Loading branch information
nyalldawson committed Nov 20, 2020
1 parent ee88c42 commit 9a075a49b7c18fc9c52471f2c5f80db57405558c
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/gui/qgsuserinputwidget.cpp
@@ -75,14 +75,14 @@ void QgsUserInputWidget::widgetDestroyed( QObject *obj )
if ( obj->isWidgetType() )
{
QWidget *w = qobject_cast<QWidget *>( obj );
QMap<QWidget *, QFrame *>::iterator i = mWidgetList.find( w );
while ( i != mWidgetList.end() )
auto it = mWidgetList.find( w );
if ( it != mWidgetList.end() )
{
if ( i.value() )
if ( QFrame *frame = it.value() )
{
i.value()->deleteLater();
frame->deleteLater();
}
i = mWidgetList.erase( i );
mWidgetList.erase( it );
}
}
if ( mWidgetList.count() == 0 )

0 comments on commit 9a075a4

Please sign in to comment.
You can’t perform that action at this time.