Class: QgsScaleComboBox¶
-
class
qgis.gui.
QgsScaleComboBox
(parent: QWidget = None)¶ Bases:
PyQt5.QtWidgets.QComboBox
Constructor for QgsScaleComboBox.
A combobox which lets the user select map scale from predefined list and highlights nearest to current scale value
Enums
Methods
Returns the minimum scale, or 0 if no minimum scale set.
Returns the selected scale as a double.
Returns the selected scale as a string, e.g.
Set the minimum allowed
scale
.Set the selected scale from a double.
Set the selected scale from a
string
, e.g.Helper function to convert a scale
string
to double.Helper function to convert a
scale
double to scale string.Sets the list of predefined
scales
to show in the combobox.Signals
Emitted when user has finished editing/selecting a new scale.
Attributes
-
actionEvent
()¶
-
changeEvent
()¶
-
childEvent
()¶
-
closeEvent
()¶
-
connectNotify
()¶
-
contextMenuEvent
()¶
-
create
()¶
-
customEvent
()¶
-
destroy
()¶
-
disconnectNotify
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
dropEvent
()¶
-
enterEvent
()¶
-
focusInEvent
()¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
()¶
-
focusPreviousChild
()¶
-
hideEvent
()¶
-
initPainter
()¶
-
initStyleOption
()¶
-
inputMethodEvent
()¶
-
isSignalConnected
()¶
-
keyPressEvent
()¶
-
keyReleaseEvent
()¶
-
leaveEvent
()¶
-
metric
()¶
-
minScale
(self) → float¶ Returns the minimum scale, or 0 if no minimum scale set. The
scale
value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. Any scale lower than the minimum scale will automatically be converted to the minimum scale. Except for 0 which is always allowed.
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
()¶
-
mousePressEvent
()¶
-
mouseReleaseEvent
()¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
paintEvent
()¶
-
receivers
()¶
-
resizeEvent
()¶
-
scale
(self) → float¶ Returns the selected scale as a double. The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
See also
-
scaleChanged
¶ Emitted when user has finished editing/selecting a new scale. The
scale
value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. [signal]
-
scaleString
(self) → str¶ Returns the selected scale as a string, e.g. “1:150”.
See also
-
sender
()¶
-
senderSignalIndex
()¶
-
setMinScale
(self, scale: float)¶ Set the minimum allowed
scale
. Set to 0 to disable the minimum scale. Thescale
value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. Any scale lower than the minimum scale will automatically be converted to the minimum scale. Except for 0 which is always allowed.
-
setScale
(self, scale: float)¶ Set the selected scale from a double. The
scale
value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.See also
-
setScaleString
(self, string: str) → bool¶ Set the selected scale from a
string
, e.g. “1:150”.See also
-
showEvent
()¶
-
showPopup
(self)¶
-
tabletEvent
()¶
-
timerEvent
()¶
-
toDouble
(string: str) → Tuple[float, bool]¶ Helper function to convert a scale
string
to double. The returned value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. If specified,ok
will be set to true if the string was successfully interpreted as a scale.See also
-
toString
(scale: float) → str¶ Helper function to convert a
scale
double to scale string. Thescale
value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.The returned string will be rounded (e.g. 1:1000, not 1:1000.345).
See also
-
updateMicroFocus
()¶
-
updateScales
(self, scales: Iterable[str] = [])¶ Sets the list of predefined
scales
to show in the combobox. List elements are expected to be valid scale strings, such as “1:1000000”.
-
wheelEvent
()¶
-