Class: QgsRatioLockButton

class qgis.gui.QgsRatioLockButton(parent: QWidget = None)

Bases: PyQt5.QtWidgets.QToolButton

Construct a new ratio lock button. Use parent to attach a parent QWidget to the button.

A cross platform button subclass used to represent a locked / unlocked ratio state.

New in version 3.0: Enums

Methods

actionEvent
changeEvent
checkStateSet
childEvent
closeEvent
connectNotify
contextMenuEvent
create
customEvent
destroy
disconnectNotify
dragEnterEvent
dragLeaveEvent
dragMoveEvent
dropEvent
enterEvent
event
focusInEvent
focusNextChild
focusNextPrevChild
focusOutEvent
focusPreviousChild
hideEvent
hitButton
initPainter
initStyleOption
inputMethodEvent
isSignalConnected
keyPressEvent
keyReleaseEvent
leaveEvent
locked Returns whether the button state is locked.
metric
mouseDoubleClickEvent
mouseMoveEvent
mousePressEvent
mouseReleaseEvent
moveEvent
nativeEvent
nextCheckState
paintEvent
receivers
resetRatio Resets the current width/height ratio, taking the width and height from the current values of the width and height spin boxes.
resizeEvent
sender
senderSignalIndex
setHeightSpinBox Registers a spin box widget as the linked “height” spin box.
setLocked Sets whether the button state is locked.
setWidthSpinBox Registers a spin box widget as the linked “width” spin box.
sharedPainter
showEvent
tabletEvent
timerEvent
updateMicroFocus
wheelEvent

Signals

lockChanged Emitted whenever the lock state changes.

Attributes

actionEvent()
changeEvent(self, e: QEvent)
checkStateSet()
childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
create()
customEvent()
destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
event()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
hitButton()
initPainter()
initStyleOption()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
lockChanged

Emitted whenever the lock state changes. [signal]

locked(self) → bool

Returns whether the button state is locked.

Returns:True if the button state is locked.

See also

setLocked()

metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
nextCheckState()
paintEvent()
receivers()
resetRatio(self)

Resets the current width/height ratio, taking the width and height from the current values of the width and height spin boxes.

resizeEvent(self, event: QResizeEvent)
sender()
senderSignalIndex()
setHeightSpinBox(self, widget: QDoubleSpinBox)

Registers a spin box widget as the linked “height” spin box.

If both a width and height spin box are linked to the button, they will automatically have their values updates when if the other spin box value is changed. I.e. changing the width spin box will automatically update the height spin box to a value which keeps the same locked ratio.

setLocked(self, locked: bool)

Sets whether the button state is locked.

Parameters:locked – locked state

See also

locked()

setWidthSpinBox(self, widget: QDoubleSpinBox)

Registers a spin box widget as the linked “width” spin box.

If both a width and height spin box are linked to the button, they will automatically have their values updates when if the other spin box value is changed. I.e. changing the width spin box will automatically update the height spin box to a value which keeps the same locked ratio.

sharedPainter()
showEvent(self, e: QShowEvent)
tabletEvent()
timerEvent()
updateMicroFocus()
wheelEvent()