From 502ad84f83e8bb1a16e25e8650038d94d6bb99d6 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 3 Sep 2024 10:32:58 +1000 Subject: [PATCH] Cleanup QgsUnitSelectionWidget docs --- .../PyQt6/gui/auto_additions/qgsunitselectionwidget.py | 4 ++++ .../gui/auto_generated/qgsunitselectionwidget.sip.in | 9 +++++++-- python/gui/auto_additions/qgsunitselectionwidget.py | 4 ++++ .../gui/auto_generated/qgsunitselectionwidget.sip.in | 9 +++++++-- src/gui/qgsunitselectionwidget.h | 10 ++++++++-- 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/python/PyQt6/gui/auto_additions/qgsunitselectionwidget.py b/python/PyQt6/gui/auto_additions/qgsunitselectionwidget.py index c3e0402219b..ad13b405314 100644 --- a/python/PyQt6/gui/auto_additions/qgsunitselectionwidget.py +++ b/python/PyQt6/gui/auto_additions/qgsunitselectionwidget.py @@ -3,3 +3,7 @@ try: QgsMapUnitScaleWidget.__attribute_docs__ = {'mapUnitScaleChanged': 'Emitted when the settings in the widget are modified.\n\n:param scale: :py:class:`QgsMapUnitScale` reflecting new settings from the widget\n'} except NameError: pass +try: + QgsUnitSelectionWidget.__attribute_docs__ = {'changed': 'Emitted when the selected unit is changed, or the definition of the map unit scale is changed.\n'} +except NameError: + pass diff --git a/python/PyQt6/gui/auto_generated/qgsunitselectionwidget.sip.in b/python/PyQt6/gui/auto_generated/qgsunitselectionwidget.sip.in index 0cea0801a0a..d799fb2dd75 100644 --- a/python/PyQt6/gui/auto_generated/qgsunitselectionwidget.sip.in +++ b/python/PyQt6/gui/auto_generated/qgsunitselectionwidget.sip.in @@ -131,8 +131,9 @@ class QgsUnitSelectionWidget : QWidget { %Docstring(signature="appended") A widget displaying a combobox allowing the user to choose between various display units, -such as millimeters or map unit. If the user chooses map units, a button appears allowing -adjustment of minimum and maximum scaling. +such as millimeters or map units. + +If the user chooses map units, a button appears allowing adjustment of minimum and maximum scaling. .. seealso:: :py:class:`QgsMapUnitScaleWidget` @@ -233,7 +234,11 @@ Sets whether the widget can show the map scale button when the Map Units option %End signals: + void changed(); +%Docstring +Emitted when the selected unit is changed, or the definition of the map unit scale is changed. +%End }; diff --git a/python/gui/auto_additions/qgsunitselectionwidget.py b/python/gui/auto_additions/qgsunitselectionwidget.py index c3e0402219b..ad13b405314 100644 --- a/python/gui/auto_additions/qgsunitselectionwidget.py +++ b/python/gui/auto_additions/qgsunitselectionwidget.py @@ -3,3 +3,7 @@ try: QgsMapUnitScaleWidget.__attribute_docs__ = {'mapUnitScaleChanged': 'Emitted when the settings in the widget are modified.\n\n:param scale: :py:class:`QgsMapUnitScale` reflecting new settings from the widget\n'} except NameError: pass +try: + QgsUnitSelectionWidget.__attribute_docs__ = {'changed': 'Emitted when the selected unit is changed, or the definition of the map unit scale is changed.\n'} +except NameError: + pass diff --git a/python/gui/auto_generated/qgsunitselectionwidget.sip.in b/python/gui/auto_generated/qgsunitselectionwidget.sip.in index 0cea0801a0a..d799fb2dd75 100644 --- a/python/gui/auto_generated/qgsunitselectionwidget.sip.in +++ b/python/gui/auto_generated/qgsunitselectionwidget.sip.in @@ -131,8 +131,9 @@ class QgsUnitSelectionWidget : QWidget { %Docstring(signature="appended") A widget displaying a combobox allowing the user to choose between various display units, -such as millimeters or map unit. If the user chooses map units, a button appears allowing -adjustment of minimum and maximum scaling. +such as millimeters or map units. + +If the user chooses map units, a button appears allowing adjustment of minimum and maximum scaling. .. seealso:: :py:class:`QgsMapUnitScaleWidget` @@ -233,7 +234,11 @@ Sets whether the widget can show the map scale button when the Map Units option %End signals: + void changed(); +%Docstring +Emitted when the selected unit is changed, or the definition of the map unit scale is changed. +%End }; diff --git a/src/gui/qgsunitselectionwidget.h b/src/gui/qgsunitselectionwidget.h index 2058d90d0b7..290c34f9cf8 100644 --- a/src/gui/qgsunitselectionwidget.h +++ b/src/gui/qgsunitselectionwidget.h @@ -155,8 +155,10 @@ class GUI_EXPORT QgsMapUnitScaleDialog : public QDialog * \class QgsUnitSelectionWidget * \ingroup gui * \brief A widget displaying a combobox allowing the user to choose between various display units, - * such as millimeters or map unit. If the user chooses map units, a button appears allowing - * adjustment of minimum and maximum scaling. + * such as millimeters or map units. + * + * If the user chooses map units, a button appears allowing adjustment of minimum and maximum scaling. + * * \see QgsMapUnitScaleWidget * \see QgsMapUnitScaleDialog */ @@ -237,6 +239,10 @@ class GUI_EXPORT QgsUnitSelectionWidget : public QWidget, private Ui::QgsUnitSel void setShowMapScaleButton( bool show ); signals: + + /** + * Emitted when the selected unit is changed, or the definition of the map unit scale is changed. + */ void changed(); private slots: