Class: QgsScaleRangeWidget¶
- class qgis.gui.QgsScaleRangeWidget¶
Bases:
PyQt5.QtWidgets.QWidget
A widget allowing entry of a range of map scales, e.g. minimum scale and maximum scale.
QgsScaleRangeWidget(parent: QWidget = None) Constructor for QgsScaleRangeWidget.
Methods
Returns the selected maximum scale (i.e. most "zoomed in" scale), or 0 if maximum scale is not set.
Returns the selected minimum scale (i.e. most "zoomed out" scale), or 0 if minimum scale is not set.
Call to reload the preset scales from the current project and apply them to the 2 scales combo boxes.
Sets the map
canvas
which will be used for the current scale buttons.Set the maximum
scale
(i.e. most "zoomed in" scale), or 0 to indicate the minimum is not set.Set the minimum
scale
(i.e. most "zoomed out" scale), or 0 to indicate the minimum is not set.Sets the scale range, from
min
scale (i.e. most "zoomed out" scale) tomax
scale (most "zoomed in" scale).Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- actionEvent(self, QActionEvent)¶
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- customEvent(self, QEvent)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- dropEvent(self, QDropEvent)¶
- enterEvent(self, QEvent)¶
- event(self, QEvent) bool ¶
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- hideEvent(self, QHideEvent)¶
- initPainter(self, QPainter)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- leaveEvent(self, QEvent)¶
- maximumScale(self) float ¶
Returns the selected maximum scale (i.e. most “zoomed in” 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
See also
- Return type:
float
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- minimumScale(self) float ¶
Returns the selected minimum scale (i.e. most “zoomed out” 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
See also
- Return type:
float
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseMoveEvent(self, QMouseEvent)¶
- mousePressEvent(self, QMouseEvent)¶
- mouseReleaseEvent(self, QMouseEvent)¶
- moveEvent(self, QMoveEvent)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int] ¶
- paintEvent(self, QPaintEvent)¶
- rangeChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- receivers(self, PYQT_SIGNAL) int ¶
- reloadProjectScales(self)¶
Call to reload the preset scales from the current project and apply them to the 2 scales combo boxes.
- resizeEvent(self, QResizeEvent)¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setMapCanvas(self, canvas: QgsMapCanvas)¶
Sets the map
canvas
which will be used for the current scale buttons. If not set, the buttons are hidden.- Parameters:
canvas (QgsMapCanvas) –
- setMaximumScale(self, scale: float)¶
Set the maximum
scale
(i.e. most “zoomed in” 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
See also
See also
Warning
Calling
setMinimumScale()
places a restriction on the acceptable maximum scale for the widget, and will alter any previously set maximum scale to pass this constraint. Always callsetMinimumScale()
beforesetMaximumScale()
when restoring a scale range in the widget, or use the convenience methodsetScaleRange()
instead.- Parameters:
scale (float) –
- setMinimumScale(self, scale: float)¶
Set the minimum
scale
(i.e. most “zoomed out” 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
See also
See also
Warning
Calling
setMinimumScale()
places a restriction on the acceptable maximum scale for the widget, and will alter any previously set maximum scale to pass this constraint. Always callsetMinimumScale()
beforesetMaximumScale()
when restoring a scale range in the widget, or use the convenience methodsetScaleRange()
instead.- Parameters:
scale (float) –
- setScaleRange(self, min: float, max: float)¶
Sets the scale range, from
min
scale (i.e. most “zoomed out” scale) tomax
scale (most “zoomed in” scale). The scale values indicates the scale denominator, e.g. 1000.0 for a 1:1000 map, or 0 to indicate not set.See also
See also
- Parameters:
min (float) –
max (float) –
- showEvent(self, QShowEvent)¶
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- wheelEvent(self, QWheelEvent)¶