Class: QgsMapUnitScaleDialog

A dialog which allows the user to choose the minimum and maximum scale of an object in map units and millimeters.

This dialog is designed to allow users to edit the properties of a QgsMapUnitScale object.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsMapUnitScaleDialog

Base classes

QDialog

QWidget

QObject

QPaintDevice

Methods

getMapUnitScale

Returns a QgsMapUnitScale representing the settings shown in the dialog.

setMapCanvas

Sets the map canvas associated with the dialog.

setMapUnitScale

Updates the dialog to reflect the settings from the specified QgsMapUnitScale object.

class qgis.gui.QgsMapUnitScaleDialog[source]

Bases: QDialog

__init__(parent: QWidget | None = None)

Constructor for QgsMapUnitScaleDialog.

Parameters:

parent (Optional[QWidget] = None) – parent widget

getMapUnitScale(self) QgsMapUnitScale[source]

Returns a QgsMapUnitScale representing the settings shown in the dialog.

Return type:

QgsMapUnitScale

setMapCanvas(self, canvas: QgsMapCanvas | None)[source]

Sets the map canvas associated with the dialog. This allows the dialog to retrieve the current map scale from the canvas.

Parameters:

canvas (Optional[QgsMapCanvas]) – map canvas

setMapUnitScale(self, scale: QgsMapUnitScale)[source]

Updates the dialog to reflect the settings from the specified QgsMapUnitScale object.

Parameters:

scale (QgsMapUnitScale) – map unit scale to show in dialog

See also

mapUnitScale()