QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
|
A cross platform button subclass used to represent a locked / unlocked ratio state. More...
#include <qgsratiolockbutton.h>
Signals | |
void | lockChanged (bool locked) |
Emitted whenever the lock state changes. | |
Public Member Functions | |
QgsRatioLockButton (QWidget *parent=nullptr) | |
Construct a new ratio lock button. | |
bool | locked () const |
Returns whether the button state is locked. | |
void | resetRatio () |
Resets the current width/height ratio, taking the width and height from the current values of the width and height spin boxes. | |
void | setHeightSpinBox (QDoubleSpinBox *widget) |
Registers a spin box widget as the linked "height" spin box. | |
void | setLocked (bool locked) |
Sets whether the button state is locked. | |
void | setWidthSpinBox (QDoubleSpinBox *widget) |
Registers a spin box widget as the linked "width" spin box. | |
Protected Member Functions | |
void | changeEvent (QEvent *e) override |
void | resizeEvent (QResizeEvent *event) override |
void | showEvent (QShowEvent *e) override |
Properties | |
bool | locked |
A cross platform button subclass used to represent a locked / unlocked ratio state.
Definition at line 34 of file qgsratiolockbutton.h.
QgsRatioLockButton::QgsRatioLockButton | ( | QWidget * | parent = nullptr | ) |
Construct a new ratio lock button.
Use parent to attach a parent QWidget to the button.
Definition at line 28 of file qgsratiolockbutton.cpp.
|
overrideprotected |
Definition at line 86 of file qgsratiolockbutton.cpp.
|
signal |
Emitted whenever the lock state changes.
|
inline |
Returns whether the button state is locked.
true
if the button state is locked. Definition at line 59 of file qgsratiolockbutton.h.
void QgsRatioLockButton::resetRatio | ( | ) |
Resets the current width/height ratio, taking the width and height from the current values of the width and height spin boxes.
Definition at line 173 of file qgsratiolockbutton.cpp.
|
overrideprotected |
Definition at line 101 of file qgsratiolockbutton.cpp.
void QgsRatioLockButton::setHeightSpinBox | ( | QDoubleSpinBox * | widget | ) |
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.
Definition at line 166 of file qgsratiolockbutton.cpp.
void QgsRatioLockButton::setLocked | ( | bool | locked | ) |
Sets whether the button state is locked.
locked | locked state |
Definition at line 38 of file qgsratiolockbutton.cpp.
void QgsRatioLockButton::setWidthSpinBox | ( | QDoubleSpinBox * | widget | ) |
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.
Definition at line 159 of file qgsratiolockbutton.cpp.
|
overrideprotected |
Definition at line 95 of file qgsratiolockbutton.cpp.
|
readwrite |
Definition at line 37 of file qgsratiolockbutton.h.