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.

Parameters

parent

actionEvent()
changeEvent(self, e: QEvent)
Parameters

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.

Return type

bool

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)
Parameters

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.

Parameters

widget (QDoubleSpinBox) –

setLocked(self, locked: bool)

Sets whether the button state is locked.

Parameters

locked (bool) – 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.

Parameters

widget (QDoubleSpinBox) –

sharedPainter()
showEvent(self, e: QShowEvent)
Parameters

e (QShowEvent) –

tabletEvent()
timerEvent()
updateMicroFocus()
wheelEvent()