Class: QgsRatioLockButton¶
- class qgis.gui.QgsRatioLockButton¶
Bases:
PyQt5.QtWidgets.QToolButton
A cross platform button subclass used to represent a locked / unlocked ratio state.
New in version 3.0.
QgsRatioLockButton(parent: QWidget = None) Construct a new ratio lock button. Use
parent
to attach a parent QWidget to the button.Methods
- param e:
Returns whether the button state is locked.
Resets the current width/height ratio, taking the width and height from the current values of the width and height spin boxes.
- param event:
Registers a spin box
widget
as the linked "height" spin box.Sets whether the button state is locked.
Registers a spin box
widget
as the linked "width" spin box.- param e:
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- actionEvent(self, QActionEvent)¶
- changeEvent(self, e: QEvent)¶
- Parameters:
e (QEvent) –
- checkStateSet(self)¶
- 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)¶
- hitButton(self, QPoint) bool ¶
- initPainter(self, QPainter)¶
- initStyleOption(self, QStyleOptionToolButton)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- leaveEvent(self, QEvent)¶
- lockChanged¶
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
- locked(self) bool ¶
Returns whether the button state is locked.
- Return type:
bool
- Returns:
True
if the button state is locked.
See also
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- 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] ¶
- nextCheckState(self)¶
- paintEvent(self, QPaintEvent)¶
- receivers(self, PYQT_SIGNAL) int ¶
- 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(self) QObject ¶
- senderSignalIndex(self) int ¶
- 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.
See also
- Parameters:
widget (QDoubleSpinBox) –
- setLocked(self, locked: bool)¶
Sets whether the button state is locked.
- Parameters:
locked (bool) – locked state
See also
- 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.
See also
- Parameters:
widget (QDoubleSpinBox) –
- showEvent(self, e: QShowEvent)¶
- Parameters:
e (QShowEvent) –
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- wheelEvent(self, QWheelEvent)¶