QGIS API Documentation 3.37.0-Master (4ace69f83af)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
QgsAdvancedDigitizingDockWidget::CadConstraint Class Reference

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.
 

Detailed Description

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.

Note
Relative is not mandatory since it is not used for distance.

Definition at line 86 of file qgsadvanceddigitizingdockwidget.h.

Member Enumeration Documentation

◆ LockMode

The lock mode.

Enumerator
NoLock 
SoftLock 
HardLock 

Definition at line 93 of file qgsadvanceddigitizingdockwidget.h.

Constructor & Destructor Documentation

◆ CadConstraint()

QgsAdvancedDigitizingDockWidget::CadConstraint::CadConstraint ( QLineEdit *  lineEdit,
QToolButton *  lockerButton,
QToolButton *  relativeButton = nullptr,
QToolButton *  repeatingLockButton = nullptr 
)
inline

Constructor for CadConstraint.

Parameters
lineEditassociated line edit for constraint value
lockerButtonassociated button for locking constraint
relativeButtonoptional button for toggling relative constraint mode
repeatingLockButtonoptional button for toggling repeating lock mode

Definition at line 107 of file qgsadvanceddigitizingdockwidget.h.

Member Function Documentation

◆ cadConstraintType()

Qgis::CadConstraintType QgsAdvancedDigitizingDockWidget::CadConstraint::cadConstraintType ( ) const

Returns the constraint type.

Since
QGIS 3.32

Definition at line 2047 of file qgsadvanceddigitizingdockwidget.cpp.

◆ displayValue()

QString QgsAdvancedDigitizingDockWidget::CadConstraint::displayValue ( ) const

Returns a localized formatted string representation of the value.

Since
QGIS 3.32

Definition at line 1996 of file qgsadvanceddigitizingdockwidget.cpp.

◆ isLocked()

bool QgsAdvancedDigitizingDockWidget::CadConstraint::isLocked ( ) const
inline

Is any kind of lock mode enabled.

Definition at line 127 of file qgsadvanceddigitizingdockwidget.h.

◆ isRepeatingLock()

bool QgsAdvancedDigitizingDockWidget::CadConstraint::isRepeatingLock ( ) const
inline

Returns true if a repeating lock is set for the constraint.

Repeating locks are not automatically cleared after a new point is added.

See also
setRepeatingLock()

Definition at line 134 of file qgsadvanceddigitizingdockwidget.h.

◆ lineEdit()

QLineEdit * QgsAdvancedDigitizingDockWidget::CadConstraint::lineEdit ( ) const
inline

The line edit that manages the value of the constraint.

Definition at line 149 of file qgsadvanceddigitizingdockwidget.h.

◆ lockMode()

LockMode QgsAdvancedDigitizingDockWidget::CadConstraint::lockMode ( ) const
inline

The current lock mode of this constraint.

Returns
Lock mode

Definition at line 122 of file qgsadvanceddigitizingdockwidget.h.

◆ precision()

int QgsAdvancedDigitizingDockWidget::CadConstraint::precision ( ) const
inline

Returns the numeric precision (decimal places) to show in the associated widget.

See also
setPrecision()
Since
QGIS 3.22

Definition at line 198 of file qgsadvanceddigitizingdockwidget.h.

◆ relative()

bool QgsAdvancedDigitizingDockWidget::CadConstraint::relative ( ) const
inline

Is the constraint in relative mode.

Definition at line 139 of file qgsadvanceddigitizingdockwidget.h.

◆ removeSuffix()

QString QgsAdvancedDigitizingDockWidget::CadConstraint::removeSuffix ( const QString &  text,
Qgis::CadConstraintType  constraintType 
)
static

Removes unit suffix from the constraint text.

Since
QGIS 3.34

Definition at line 2062 of file qgsadvanceddigitizingdockwidget.cpp.

◆ setCadConstraintType()

void QgsAdvancedDigitizingDockWidget::CadConstraint::setCadConstraintType ( Qgis::CadConstraintType  constraintType)

Sets the constraint type to constraintType.

Since
QGIS 3.32

Definition at line 2052 of file qgsadvanceddigitizingdockwidget.cpp.

◆ setLockMode()

void QgsAdvancedDigitizingDockWidget::CadConstraint::setLockMode ( LockMode  mode)

Set the lock mode.

Definition at line 1945 of file qgsadvanceddigitizingdockwidget.cpp.

◆ setMapCanvas()

void QgsAdvancedDigitizingDockWidget::CadConstraint::setMapCanvas ( QgsMapCanvas mapCanvas)

Sets the map canvas to mapCanvas.

Since
QGIS 3.32

Definition at line 2057 of file qgsadvanceddigitizingdockwidget.cpp.

◆ setPrecision()

void QgsAdvancedDigitizingDockWidget::CadConstraint::setPrecision ( int  precision)

Sets the numeric precision (decimal places) to show in the associated widget.

See also
precision()
Since
QGIS 3.22

Definition at line 2040 of file qgsadvanceddigitizingdockwidget.cpp.

◆ setRelative()

void QgsAdvancedDigitizingDockWidget::CadConstraint::setRelative ( bool  relative)

Set if the constraint should be treated relative.

Definition at line 1980 of file qgsadvanceddigitizingdockwidget.cpp.

◆ setRepeatingLock()

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.

Parameters
repeatingset to true to set the lock to repeat automatically
See also
isRepeatingLock()

Definition at line 1973 of file qgsadvanceddigitizingdockwidget.cpp.

◆ setValue()

void QgsAdvancedDigitizingDockWidget::CadConstraint::setValue ( double  value,
bool  updateWidget = true 
)

Set the value of the constraint.

Parameters
valuenew value for constraint
updateWidgetset to false to prevent automatically updating the associated widget's value

Definition at line 1989 of file qgsadvanceddigitizingdockwidget.cpp.

◆ toggleLocked()

void QgsAdvancedDigitizingDockWidget::CadConstraint::toggleLocked ( )

Toggle lock mode.

Definition at line 2030 of file qgsadvanceddigitizingdockwidget.cpp.

◆ toggleRelative()

void QgsAdvancedDigitizingDockWidget::CadConstraint::toggleRelative ( )

Toggle relative mode.

Definition at line 2035 of file qgsadvanceddigitizingdockwidget.cpp.

◆ value()

double QgsAdvancedDigitizingDockWidget::CadConstraint::value ( ) const
inline

The value of the constraint.

Definition at line 144 of file qgsadvanceddigitizingdockwidget.h.


The documentation for this class was generated from the following files: