diff --git a/python/gui/qgsuserinputdockwidget.sip b/python/gui/qgsuserinputdockwidget.sip index 75059c711a5..04430943458 100644 --- a/python/gui/qgsuserinputdockwidget.sip +++ b/python/gui/qgsuserinputdockwidget.sip @@ -1,4 +1,9 @@ - +/** \ingroup gui + * @brief The QgsUserInputDockWidget class is a dock widget that shall be used to display widgets for user inputs. + * It can be used by map tools, plugins, etc. + * Several widgets can be displayed at once, they will be separated by a separator. Widgets will be either layout horizontally or vertically. + * The dock is automatically hidden if it contains no widget. + */ class QgsUserInputDockWidget : QDockWidget { %TypeHeaderCode @@ -9,7 +14,9 @@ class QgsUserInputDockWidget : QDockWidget QgsUserInputDockWidget( QWidget* parent /TransferThis/ = 0 ); ~QgsUserInputDockWidget(); - //! add a widget to be displayed in the dock + /** Add a widget to be displayed in the dock. + * @param widget widget to add. Ownership is not transferred. + */ void addUserInputWidget( QWidget* widget ); protected: diff --git a/src/gui/qgsuserinputdockwidget.cpp b/src/gui/qgsuserinputdockwidget.cpp index 462db9c86a3..d3ac7b30efd 100644 --- a/src/gui/qgsuserinputdockwidget.cpp +++ b/src/gui/qgsuserinputdockwidget.cpp @@ -69,8 +69,7 @@ void QgsUserInputDockWidget::widgetDestroyed( QObject *obj ) { i.value()->deleteLater(); } - mWidgetList.remove( i.key() ); - ++i; + i = mWidgetList.erase( i ); } } } diff --git a/src/gui/qgsuserinputdockwidget.h b/src/gui/qgsuserinputdockwidget.h index 026a8b06c9c..4d39931e2d8 100644 --- a/src/gui/qgsuserinputdockwidget.h +++ b/src/gui/qgsuserinputdockwidget.h @@ -38,7 +38,9 @@ class GUI_EXPORT QgsUserInputDockWidget : public QgsDockWidget QgsUserInputDockWidget( QWidget* parent = nullptr ); ~QgsUserInputDockWidget(); - //! add a widget to be displayed in the dock + /** Add a widget to be displayed in the dock. + * @param widget widget to add. Ownership is not transferred. + */ void addUserInputWidget( QWidget* widget ); protected: