QGIS API Documentation  3.4.15-Madeira (e83d02e274)
Public Types | Public Member Functions | List of all members
QgsAdvancedDigitizingDockWidget::CadConstraint Class Reference

The CadConstraint is an abstract 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. More...
 
bool isLocked () const
 Is any kind of lock mode enabled. More...
 
bool isRepeatingLock () const
 Returns true if a repeating lock is set for the constraint. More...
 
QLineEdit * lineEdit () const
 The line edit that manages the value of the constraint. More...
 
LockMode lockMode () const
 The current lock mode of this constraint. More...
 
bool relative () const
 Is the constraint in relative mode. More...
 
void setLockMode (LockMode mode)
 Set the lock mode. More...
 
void setRelative (bool relative)
 Set if the constraint should be treated relative. More...
 
void setRepeatingLock (bool repeating)
 Sets whether a repeating lock is set for the constraint. More...
 
void setValue (double value, bool updateWidget=true)
 Set the value of the constraint. More...
 
void toggleLocked ()
 Toggle lock mode. More...
 
void toggleRelative ()
 Toggle relative mode. More...
 
double value () const
 The value of the constraint. More...
 

Detailed Description

The CadConstraint is an abstract 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 82 of file qgsadvanceddigitizingdockwidget.h.

Member Enumeration Documentation

The lock mode.

Enumerator
NoLock 
SoftLock 
HardLock 

Definition at line 89 of file qgsadvanceddigitizingdockwidget.h.

Constructor & Destructor Documentation

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 103 of file qgsadvanceddigitizingdockwidget.h.

Member Function Documentation

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

Is any kind of lock mode enabled.

Definition at line 123 of file qgsadvanceddigitizingdockwidget.h.

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()
Since
QGIS 2.16

Definition at line 131 of file qgsadvanceddigitizingdockwidget.h.

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

The line edit that manages the value of the constraint.

Definition at line 146 of file qgsadvanceddigitizingdockwidget.h.

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

The current lock mode of this constraint.

Returns
Lock mode

Definition at line 118 of file qgsadvanceddigitizingdockwidget.h.

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

Is the constraint in relative mode.

Definition at line 136 of file qgsadvanceddigitizingdockwidget.h.

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

Set the lock mode.

Definition at line 1073 of file qgsadvanceddigitizingdockwidget.cpp.

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

Set if the constraint should be treated relative.

Definition at line 1103 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.

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

Definition at line 1096 of file qgsadvanceddigitizingdockwidget.cpp.

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 1112 of file qgsadvanceddigitizingdockwidget.cpp.

void QgsAdvancedDigitizingDockWidget::CadConstraint::toggleLocked ( )

Toggle lock mode.

Definition at line 1119 of file qgsadvanceddigitizingdockwidget.cpp.

void QgsAdvancedDigitizingDockWidget::CadConstraint::toggleRelative ( )

Toggle relative mode.

Definition at line 1124 of file qgsadvanceddigitizingdockwidget.cpp.

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

The value of the constraint.

Definition at line 141 of file qgsadvanceddigitizingdockwidget.h.


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