Skip to content

Commit

Permalink
Fix logic in QgsUserInputWidget which incorrectly deletes other
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nyalldawson committed Oct 28, 2020
1 parent 912dd77 commit d8351c0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/gui/qgsuserinputwidget.cpp
Expand Up @@ -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 ( auto *lValue = i.value() )
if ( QFrame *frame = it.value() )
{
lValue->deleteLater();
frame->deleteLater();
}
i = mWidgetList.erase( i );
mWidgetList.erase( it );
}
}
if ( mWidgetList.count() == 0 )
Expand Down

0 comments on commit d8351c0

Please sign in to comment.