Cleanup QgsUnitSelectionWidget docs

This commit is contained in:
Nyall Dawson 2024-09-03 10:32:58 +10:00
parent 8f6b511b0b
commit 502ad84f83
5 changed files with 30 additions and 6 deletions

View File

@ -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'} 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: except NameError:
pass 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

View File

@ -131,8 +131,9 @@ class QgsUnitSelectionWidget : QWidget
{ {
%Docstring(signature="appended") %Docstring(signature="appended")
A widget displaying a combobox allowing the user to choose between various display units, 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 such as millimeters or map units.
adjustment of minimum and maximum scaling.
If the user chooses map units, a button appears allowing adjustment of minimum and maximum scaling.
.. seealso:: :py:class:`QgsMapUnitScaleWidget` .. seealso:: :py:class:`QgsMapUnitScaleWidget`
@ -233,7 +234,11 @@ Sets whether the widget can show the map scale button when the Map Units option
%End %End
signals: signals:
void changed(); void changed();
%Docstring
Emitted when the selected unit is changed, or the definition of the map unit scale is changed.
%End
}; };

View File

@ -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'} 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: except NameError:
pass 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

View File

@ -131,8 +131,9 @@ class QgsUnitSelectionWidget : QWidget
{ {
%Docstring(signature="appended") %Docstring(signature="appended")
A widget displaying a combobox allowing the user to choose between various display units, 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 such as millimeters or map units.
adjustment of minimum and maximum scaling.
If the user chooses map units, a button appears allowing adjustment of minimum and maximum scaling.
.. seealso:: :py:class:`QgsMapUnitScaleWidget` .. seealso:: :py:class:`QgsMapUnitScaleWidget`
@ -233,7 +234,11 @@ Sets whether the widget can show the map scale button when the Map Units option
%End %End
signals: signals:
void changed(); void changed();
%Docstring
Emitted when the selected unit is changed, or the definition of the map unit scale is changed.
%End
}; };

View File

@ -155,8 +155,10 @@ class GUI_EXPORT QgsMapUnitScaleDialog : public QDialog
* \class QgsUnitSelectionWidget * \class QgsUnitSelectionWidget
* \ingroup gui * \ingroup gui
* \brief A widget displaying a combobox allowing the user to choose between various display units, * \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 * such as millimeters or map units.
* adjustment of minimum and maximum scaling. *
* If the user chooses map units, a button appears allowing adjustment of minimum and maximum scaling.
*
* \see QgsMapUnitScaleWidget * \see QgsMapUnitScaleWidget
* \see QgsMapUnitScaleDialog * \see QgsMapUnitScaleDialog
*/ */
@ -237,6 +239,10 @@ class GUI_EXPORT QgsUnitSelectionWidget : public QWidget, private Ui::QgsUnitSel
void setShowMapScaleButton( bool show ); void setShowMapScaleButton( bool show );
signals: signals:
/**
* Emitted when the selected unit is changed, or the definition of the map unit scale is changed.
*/
void changed(); void changed();
private slots: private slots: