Class: QgsScaleVisibilityDialog

A dialog allowing users to enter a scale visibility range.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsScaleVisibilityDialog

Base classes

QDialog

QWidget

QObject

QPaintDevice

Methods

hasScaleVisibility

Returns True if scale based visibility is enabled.

maximumScale

Returns the selected maximum scale, or 0 if maximum scale is not set.

minimumScale

Returns the selected minimum scale, or 0 if minimum scale is not set.

setMaximumScale

Set the maximum scale, or 0 to indicate the minimum is not set.

setMinimumScale

Set the minimum scale, or 0 to indicate the minimum is not set.

setScaleVisibility

Set whether scale based visibility is enabled.

setScaleVisiblity

Set whether scale based visibility is enabled.

class qgis.gui.QgsScaleVisibilityDialog[source]

Bases: QDialog

__init__(parent: QWidget | None = None, title: str | None = '', mapCanvas: QgsMapCanvas | None = None)

Constructor for QgsScaleVisibilityDialog, with specified dialog title. The mapCanvas argument can be used to associate the dialog with a map canvas, allowing use of the current map scale within the dialog.

Parameters:
  • parent (Optional[QWidget] = None)

  • title (Optional[str] = '')

  • mapCanvas (Optional[QgsMapCanvas] = None)

hasScaleVisibility(self) bool[source]

Returns True if scale based visibility is enabled.

Return type:

bool

maximumScale(self) float[source]

Returns the selected maximum scale, or 0 if maximum scale is not set. The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.

See also

minimumScale()

Return type:

float

minimumScale(self) float[source]

Returns the selected minimum scale, or 0 if minimum scale is not set. The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.

See also

maximumScale()

Return type:

float

setMaximumScale(self, scale: float)[source]

Set the maximum scale, or 0 to indicate the minimum is not set. The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.

See also

maximumScale()

Parameters:

scale (float)

setMinimumScale(self, scale: float)[source]

Set the minimum scale, or 0 to indicate the minimum is not set. The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.

See also

minimumScale()

Parameters:

scale (float)

setScaleVisibility(self, hasScaleVisibility: bool)[source]

Set whether scale based visibility is enabled.

Added in version 3.38.

Parameters:

hasScaleVisibility (bool)

setScaleVisiblity(self, hasScaleVisibility: bool)[source]

Set whether scale based visibility is enabled.

Deprecated since version 3.40: Use setScaleVisibility().

Parameters:

hasScaleVisibility (bool)