A cross platform button subclass used to represent a locked / unlocked ratio state.
More...
#include <qgsratiolockbutton.h>
|
| QgsRatioLockButton (QWidget *parent=nullptr) |
| Construct a new ratio lock button. More...
|
|
bool | locked () const |
| Returns whether the button state is locked. More...
|
|
void | resetRatio () |
| Resets the current width/height ratio, taking the width and height from the current values of the width and height spin boxes. More...
|
|
void | setHeightSpinBox (QDoubleSpinBox *widget) |
| Registers a spin box widget as the linked "height" spin box. More...
|
|
void | setLocked (bool locked) |
| Sets whether the button state is locked. More...
|
|
void | setWidthSpinBox (QDoubleSpinBox *widget) |
| Registers a spin box widget as the linked "width" spin box. More...
|
|
A cross platform button subclass used to represent a locked / unlocked ratio state.
- Since
- QGIS 3.0
Definition at line 34 of file qgsratiolockbutton.h.
◆ QgsRatioLockButton()
QgsRatioLockButton::QgsRatioLockButton |
( |
QWidget * |
parent = nullptr | ) |
|
Construct a new ratio lock button.
Use parent to attach a parent QWidget to the button.
Definition at line 26 of file qgsratiolockbutton.cpp.
◆ changeEvent()
void QgsRatioLockButton::changeEvent |
( |
QEvent * |
e | ) |
|
|
overrideprotected |
◆ lockChanged
void QgsRatioLockButton::lockChanged |
( |
bool |
locked | ) |
|
|
signal |
Emitted whenever the lock state changes.
◆ locked()
bool QgsRatioLockButton::locked |
( |
| ) |
const |
|
inline |
Returns whether the button state is locked.
- Returns
true
if the button state is locked.
- See also
- setLocked
Definition at line 59 of file qgsratiolockbutton.h.
◆ resetRatio()
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 159 of file qgsratiolockbutton.cpp.
◆ resizeEvent()
void QgsRatioLockButton::resizeEvent |
( |
QResizeEvent * |
event | ) |
|
|
overrideprotected |
◆ setHeightSpinBox()
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.
- See also
- setWidthSpinBox()
Definition at line 152 of file qgsratiolockbutton.cpp.
◆ setLocked()
void QgsRatioLockButton::setLocked |
( |
bool |
locked | ) |
|
◆ setWidthSpinBox()
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.
- See also
- setHeightSpinBox()
Definition at line 145 of file qgsratiolockbutton.cpp.
◆ showEvent()
void QgsRatioLockButton::showEvent |
( |
QShowEvent * |
e | ) |
|
|
overrideprotected |
◆ locked
bool QgsRatioLockButton::locked |
|
readwrite |
The documentation for this class was generated from the following files: