QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
The CadConstraint is a class for all basic constraints (angle/distance/x/y). More...
#include <qgsadvanceddigitizingdockwidget.h>
Public Types | |
enum | LockMode { NoLock , SoftLock , HardLock } |
The lock mode. More... | |
Public Member Functions | |
CadConstraint (QLineEdit *lineEdit, QToolButton *lockerButton, QToolButton *relativeButton=nullptr, QToolButton *repeatingLockButton=nullptr) | |
Constructor for CadConstraint. | |
Qgis::CadConstraintType | cadConstraintType () const |
Returns the constraint type. | |
QString | displayValue () const |
Returns a localized formatted string representation of the value. | |
bool | isLocked () const |
Is any kind of lock mode enabled. | |
bool | isRepeatingLock () const |
Returns true if a repeating lock is set for the constraint. | |
QLineEdit * | lineEdit () const |
The line edit that manages the value of the constraint. | |
LockMode | lockMode () const |
The current lock mode of this constraint. | |
int | precision () const |
Returns the numeric precision (decimal places) to show in the associated widget. | |
bool | relative () const |
Is the constraint in relative mode. | |
void | setCadConstraintType (Qgis::CadConstraintType constraintType) |
Sets the constraint type to constraintType. | |
void | setLockMode (LockMode mode) |
Set the lock mode. | |
void | setMapCanvas (QgsMapCanvas *mapCanvas) |
Sets the map canvas to mapCanvas. | |
void | setPrecision (int precision) |
Sets the numeric precision (decimal places) to show in the associated widget. | |
void | setRelative (bool relative) |
Set if the constraint should be treated relative. | |
void | setRepeatingLock (bool repeating) |
Sets whether a repeating lock is set for the constraint. | |
void | setValue (double value, bool updateWidget=true) |
Set the value of the constraint. | |
void | toggleLocked () |
Toggle lock mode. | |
void | toggleRelative () |
Toggle relative mode. | |
double | value () const |
The value of the constraint. | |
Static Public Member Functions | |
static QString | removeSuffix (const QString &text, Qgis::CadConstraintType constraintType) |
Removes unit suffix from the constraint text. | |
The CadConstraint is a class for all basic constraints (angle/distance/x/y).
It contains all values (locked, value, relative) and pointers to corresponding widgets.
Definition at line 89 of file qgsadvanceddigitizingdockwidget.h.
The lock mode.
Enumerator | |
---|---|
NoLock | |
SoftLock | |
HardLock |
Definition at line 96 of file qgsadvanceddigitizingdockwidget.h.
|
inline |
Constructor for CadConstraint.
lineEdit | associated line edit for constraint value |
lockerButton | associated button for locking constraint |
relativeButton | optional button for toggling relative constraint mode |
repeatingLockButton | optional button for toggling repeating lock mode |
Definition at line 110 of file qgsadvanceddigitizingdockwidget.h.
Qgis::CadConstraintType QgsAdvancedDigitizingDockWidget::CadConstraint::cadConstraintType | ( | ) | const |
Returns the constraint type.
Definition at line 2371 of file qgsadvanceddigitizingdockwidget.cpp.
QString QgsAdvancedDigitizingDockWidget::CadConstraint::displayValue | ( | ) | const |
Returns a localized formatted string representation of the value.
Definition at line 2317 of file qgsadvanceddigitizingdockwidget.cpp.
|
inline |
Is any kind of lock mode enabled.
Definition at line 130 of file qgsadvanceddigitizingdockwidget.h.
|
inline |
Returns true
if a repeating lock is set for the constraint.
Repeating locks are not automatically cleared after a new point is added.
Definition at line 137 of file qgsadvanceddigitizingdockwidget.h.
|
inline |
The line edit that manages the value of the constraint.
Definition at line 152 of file qgsadvanceddigitizingdockwidget.h.
|
inline |
The current lock mode of this constraint.
Definition at line 125 of file qgsadvanceddigitizingdockwidget.h.
|
inline |
Returns the numeric precision (decimal places) to show in the associated widget.
Definition at line 201 of file qgsadvanceddigitizingdockwidget.h.
|
inline |
Is the constraint in relative mode.
Definition at line 142 of file qgsadvanceddigitizingdockwidget.h.
|
static |
Removes unit suffix from the constraint text.
Definition at line 2386 of file qgsadvanceddigitizingdockwidget.cpp.
void QgsAdvancedDigitizingDockWidget::CadConstraint::setCadConstraintType | ( | Qgis::CadConstraintType | constraintType | ) |
Sets the constraint type to constraintType.
Definition at line 2376 of file qgsadvanceddigitizingdockwidget.cpp.
void QgsAdvancedDigitizingDockWidget::CadConstraint::setLockMode | ( | LockMode | mode | ) |
Set the lock mode.
Definition at line 2266 of file qgsadvanceddigitizingdockwidget.cpp.
void QgsAdvancedDigitizingDockWidget::CadConstraint::setMapCanvas | ( | QgsMapCanvas * | mapCanvas | ) |
Sets the map canvas to mapCanvas.
Definition at line 2381 of file qgsadvanceddigitizingdockwidget.cpp.
void QgsAdvancedDigitizingDockWidget::CadConstraint::setPrecision | ( | int | precision | ) |
Sets the numeric precision (decimal places) to show in the associated widget.
Definition at line 2364 of file qgsadvanceddigitizingdockwidget.cpp.
void QgsAdvancedDigitizingDockWidget::CadConstraint::setRelative | ( | bool | relative | ) |
Set if the constraint should be treated relative.
Definition at line 2301 of file qgsadvanceddigitizingdockwidget.cpp.
void QgsAdvancedDigitizingDockWidget::CadConstraint::setRepeatingLock | ( | bool | repeating | ) |
Sets whether a repeating lock is set for the constraint.
Repeating locks are not automatically cleared after a new point is added.
repeating | set to true to set the lock to repeat automatically |
Definition at line 2294 of file qgsadvanceddigitizingdockwidget.cpp.
void QgsAdvancedDigitizingDockWidget::CadConstraint::setValue | ( | double | value, |
bool | updateWidget = true |
||
) |
Set the value of the constraint.
value | new value for constraint |
updateWidget | set to false to prevent automatically updating the associated widget's value |
Definition at line 2310 of file qgsadvanceddigitizingdockwidget.cpp.
void QgsAdvancedDigitizingDockWidget::CadConstraint::toggleLocked | ( | ) |
Toggle lock mode.
Definition at line 2354 of file qgsadvanceddigitizingdockwidget.cpp.
void QgsAdvancedDigitizingDockWidget::CadConstraint::toggleRelative | ( | ) |
Toggle relative mode.
Definition at line 2359 of file qgsadvanceddigitizingdockwidget.cpp.
|
inline |
The value of the constraint.
Definition at line 147 of file qgsadvanceddigitizingdockwidget.h.