QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
qgsadvanceddigitizingfloater.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsadvanceddigitizingfloater.cpp - floater for CAD tools
3  ----------------------
4  begin : May 2019
5  copyright : (C) Olivier Dalang
6  email : [email protected]
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #include <QMouseEvent>
17 #include <QEnterEvent>
18 #include <QLocale>
19 
21 #include "qgsmessagelog.h"
22 #include "qgsmapcanvas.h"
23 #include "qgssettings.h"
24 #include "qgsfocuswatcher.h"
25 
27  : QWidget( canvas->viewport() ), mMapCanvas( canvas ), mCadDockWidget( cadDockWidget )
28 {
29  setupUi( this );
30 
31  setAttribute( Qt::WA_TransparentForMouseEvents );
32  adjustSize();
33 
34  setActive( QgsSettings().value( QStringLiteral( "/Cad/Floater" ), false ).toBool() );
35 
36  hideIfDisabled();
37 
38  // This is required to be able to track mouse move events
39  mMapCanvas->viewport()->installEventFilter( this );
40  mMapCanvas->viewport()->setMouseTracking( true );
41 
42  // We reuse cadDockWidget's eventFilter for the CAD specific shortcuts
43  mAngleLineEdit->installEventFilter( cadDockWidget );
44  mDistanceLineEdit->installEventFilter( cadDockWidget );
45  mXLineEdit->installEventFilter( cadDockWidget );
46  mYLineEdit->installEventFilter( cadDockWidget );
47  mZLineEdit->installEventFilter( cadDockWidget );
48  mMLineEdit->installEventFilter( cadDockWidget );
49 
50  // Connect all cadDockWidget's signals to update the widget's display
51  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::cadEnabledChanged, this, &QgsAdvancedDigitizingFloater::hideIfDisabled );
52 
53  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::valueXChanged, this, &QgsAdvancedDigitizingFloater::changeX );
54  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::valueYChanged, this, &QgsAdvancedDigitizingFloater::changeY );
55  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::valueZChanged, this, &QgsAdvancedDigitizingFloater::changeZ );
56  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::valueMChanged, this, &QgsAdvancedDigitizingFloater::changeM );
57  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::valueAngleChanged, this, &QgsAdvancedDigitizingFloater::changeAngle );
58  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::valueDistanceChanged, this, &QgsAdvancedDigitizingFloater::changeDistance );
59 
60  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::lockXChanged, this, &QgsAdvancedDigitizingFloater::changeLockX );
61  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::lockYChanged, this, &QgsAdvancedDigitizingFloater::changeLockY );
62  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::lockZChanged, this, &QgsAdvancedDigitizingFloater::changeLockZ );
63  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::lockMChanged, this, &QgsAdvancedDigitizingFloater::changeLockM );
64  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::lockAngleChanged, this, &QgsAdvancedDigitizingFloater::changeLockAngle );
65  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::lockDistanceChanged, this, &QgsAdvancedDigitizingFloater::changeLockDistance );
66 
67  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::relativeXChanged, this, &QgsAdvancedDigitizingFloater::changeRelativeX );
68  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::relativeYChanged, this, &QgsAdvancedDigitizingFloater::changeRelativeY );
69  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::relativeZChanged, this, &QgsAdvancedDigitizingFloater::changeRelativeZ );
70  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::relativeMChanged, this, &QgsAdvancedDigitizingFloater::changeRelativeM );
71  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::relativeAngleChanged, this, &QgsAdvancedDigitizingFloater::changeRelativeAngle );
72  // distance is always relative
73 
74  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::focusOnXRequested, this, &QgsAdvancedDigitizingFloater::focusOnX );
75  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::focusOnYRequested, this, &QgsAdvancedDigitizingFloater::focusOnY );
76  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::focusOnZRequested, this, &QgsAdvancedDigitizingFloater::focusOnZ );
77  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::focusOnMRequested, this, &QgsAdvancedDigitizingFloater::focusOnM );
78  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::focusOnAngleRequested, this, &QgsAdvancedDigitizingFloater::focusOnAngle );
79  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::focusOnDistanceRequested, this, &QgsAdvancedDigitizingFloater::focusOnDistance );
80 
81  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::enabledChangedX, this, &QgsAdvancedDigitizingFloater::enabledChangedX );
82  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::enabledChangedY, this, &QgsAdvancedDigitizingFloater::enabledChangedY );
83  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::enabledChangedZ, this, &QgsAdvancedDigitizingFloater::enabledChangedZ );
84  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::enabledChangedM, this, &QgsAdvancedDigitizingFloater::enabledChangedM );
85  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::enabledChangedAngle, this, &QgsAdvancedDigitizingFloater::enabledChangedAngle );
86  connect( cadDockWidget, &QgsAdvancedDigitizingDockWidget::enabledChangedDistance, this, &QgsAdvancedDigitizingFloater::enabledChangedDistance );
87 
88  // Connect our line edits signals to update cadDockWidget's state (implementation copied from QgsAdvancedDigitizingDockWidget)
89  connect( mXLineEdit, &QLineEdit::returnPressed, cadDockWidget, [ = ]() { cadDockWidget->setX( mXLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::ReturnPressed ); } );
90  connect( mYLineEdit, &QLineEdit::returnPressed, cadDockWidget, [ = ]() { cadDockWidget->setY( mYLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::ReturnPressed ); } );
91  connect( mZLineEdit, &QLineEdit::returnPressed, cadDockWidget, [ = ]() { cadDockWidget->setZ( mZLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::ReturnPressed ); } );
92  connect( mMLineEdit, &QLineEdit::returnPressed, cadDockWidget, [ = ]() { cadDockWidget->setM( mMLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::ReturnPressed ); } );
93  connect( mAngleLineEdit, &QLineEdit::returnPressed, cadDockWidget, [ = ]() { cadDockWidget->setAngle( mAngleLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::ReturnPressed ); } );
94  connect( mDistanceLineEdit, &QLineEdit::returnPressed, cadDockWidget, [ = ]() { cadDockWidget->setDistance( mDistanceLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::ReturnPressed ); } );
95 
96  connect( mXLineEdit, &QLineEdit::textEdited, cadDockWidget, [ = ]() { cadDockWidget->setX( mXLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::TextEdited ); } );
97  connect( mYLineEdit, &QLineEdit::textEdited, cadDockWidget, [ = ]() { cadDockWidget->setY( mYLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::TextEdited ); } );
98  connect( mZLineEdit, &QLineEdit::textEdited, cadDockWidget, [ = ]() { cadDockWidget->setZ( mZLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::TextEdited ); } );
99  connect( mMLineEdit, &QLineEdit::textEdited, cadDockWidget, [ = ]() { cadDockWidget->setM( mMLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::TextEdited ); } );
100  connect( mAngleLineEdit, &QLineEdit::textEdited, cadDockWidget, [ = ]() { cadDockWidget->setAngle( mAngleLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::TextEdited ); } );
101  connect( mDistanceLineEdit, &QLineEdit::textEdited, cadDockWidget, [ = ]() { cadDockWidget->setDistance( mDistanceLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::TextEdited ); } );
102 
103  QgsFocusWatcher *xWatcher = new QgsFocusWatcher( mXLineEdit );
104  connect( xWatcher, &QgsFocusWatcher::focusOut, cadDockWidget, [ = ]() { cadDockWidget->setX( mXLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::FocusOut ); } );
105  QgsFocusWatcher *yWatcher = new QgsFocusWatcher( mYLineEdit );
106  connect( yWatcher, &QgsFocusWatcher::focusOut, cadDockWidget, [ = ]() { cadDockWidget->setY( mYLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::FocusOut ); } );
107  QgsFocusWatcher *zWatcher = new QgsFocusWatcher( mZLineEdit );
108  connect( zWatcher, &QgsFocusWatcher::focusOut, cadDockWidget, [ = ]() { cadDockWidget->setZ( mZLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::FocusOut ); } );
109  QgsFocusWatcher *mWatcher = new QgsFocusWatcher( mYLineEdit );
110  connect( mWatcher, &QgsFocusWatcher::focusOut, cadDockWidget, [ = ]() { cadDockWidget->setM( mMLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::FocusOut ); } );
111  QgsFocusWatcher *angleWatcher = new QgsFocusWatcher( mAngleLineEdit );
112  connect( angleWatcher, &QgsFocusWatcher::focusOut, cadDockWidget, [ = ]() { cadDockWidget->setAngle( mAngleLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::FocusOut ); } );
113  QgsFocusWatcher *distanceWatcher = new QgsFocusWatcher( mDistanceLineEdit );
114  connect( distanceWatcher, &QgsFocusWatcher::focusOut, cadDockWidget, [ = ]() { cadDockWidget->setDistance( mDistanceLineEdit->text(), QgsAdvancedDigitizingDockWidget::WidgetSetMode::FocusOut ); } );
115 
116 }
117 
118 bool QgsAdvancedDigitizingFloater::eventFilter( QObject *obj, QEvent *event )
119 {
120  if ( mCadDockWidget->cadEnabled() && mActive )
121  {
122  if ( event->type() == QEvent::MouseMove )
123  {
124  // We update the position when mouse moves
125  QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent *>( event );
126  updatePos( mouseEvent->pos() );
127  }
128  else if ( event->type() == QEvent::Enter )
129  {
130  // We show the widget when mouse enters
131  QEnterEvent *enterEvent = dynamic_cast<QEnterEvent *>( event );
132  updatePos( enterEvent->pos() );
133  setVisible( true );
134  }
135  else if ( event->type() == QEvent::Leave )
136  {
137  // We hide the widget when mouse leaves
138  setVisible( false );
139  }
140  }
141  return QWidget::eventFilter( obj, event );
142 }
143 
145 {
146  return mActive;
147 }
148 
150 {
151  QgsSettings().setValue( QStringLiteral( "/Cad/Floater" ), active );
152 
153  mActive = active;
154 
155  hideIfDisabled();
156 }
157 
158 void QgsAdvancedDigitizingFloater::updatePos( const QPoint &pos )
159 {
160  // We hardcode a small delta between the mouse position and the widget's position
161  move( pos + QPoint( 15, 5 ) );
162 }
163 
164 void QgsAdvancedDigitizingFloater::hideIfDisabled()
165 {
166  if ( ! mCadDockWidget->cadEnabled() || ! mActive )
167  {
168  setVisible( false );
169  }
170 }
171 
172 void QgsAdvancedDigitizingFloater::changeX( const QString &text )
173 {
174  mXLineEdit->setText( text );
175 }
176 
177 void QgsAdvancedDigitizingFloater::changeY( const QString &text )
178 {
179  mYLineEdit->setText( text );
180 }
181 
182 void QgsAdvancedDigitizingFloater::changeZ( const QString &text )
183 {
184  mZLineEdit->setText( text );
185 }
186 
187 void QgsAdvancedDigitizingFloater::changeM( const QString &text )
188 {
189  mMLineEdit->setText( text );
190 }
191 
192 void QgsAdvancedDigitizingFloater::changeDistance( const QString &text )
193 {
194  mDistanceLineEdit->setText( text );
195 }
196 
197 void QgsAdvancedDigitizingFloater::changeAngle( const QString &text )
198 {
199  mAngleLineEdit->setText( text );
200 }
201 
202 void QgsAdvancedDigitizingFloater::changeLockX( bool locked )
203 {
204  if ( !locked )
205  {
206  mXLineEdit->setStyleSheet( QString() );
207  mXLabel->setStyleSheet( QString() );
208  }
209  else
210  {
211  mXLineEdit->setStyleSheet( QStringLiteral( "font-weight: bold" ) );
212  mXLabel->setStyleSheet( QStringLiteral( "font-weight: bold" ) );
213  }
214 }
215 
216 void QgsAdvancedDigitizingFloater::changeLockY( bool locked )
217 {
218  if ( !locked )
219  {
220  mYLineEdit->setStyleSheet( QString() );
221  mYLabel->setStyleSheet( QString() );
222  }
223  else
224  {
225  mYLineEdit->setStyleSheet( QStringLiteral( "font-weight: bold" ) );
226  mYLabel->setStyleSheet( QStringLiteral( "font-weight: bold" ) );
227  }
228 }
229 
230 void QgsAdvancedDigitizingFloater::changeLockZ( bool locked )
231 {
232  if ( !locked )
233  {
234  mZLineEdit->setStyleSheet( QString() );
235  mZLabel->setStyleSheet( QString() );
236  }
237  else
238  {
239  mZLineEdit->setStyleSheet( QStringLiteral( "font-weight: bold" ) );
240  mZLabel->setStyleSheet( QStringLiteral( "font-weight: bold" ) );
241  }
242 }
243 
244 void QgsAdvancedDigitizingFloater::changeLockM( bool locked )
245 {
246  if ( !locked )
247  {
248  mMLineEdit->setStyleSheet( QString() );
249  mMLabel->setStyleSheet( QString() );
250  }
251  else
252  {
253  mMLineEdit->setStyleSheet( QStringLiteral( "font-weight: bold" ) );
254  mMLabel->setStyleSheet( QStringLiteral( "font-weight: bold" ) );
255  }
256 }
257 
258 void QgsAdvancedDigitizingFloater::changeLockDistance( bool locked )
259 {
260  if ( !locked )
261  {
262  mDistanceLineEdit->setStyleSheet( QString() );
263  mDistanceLabel->setStyleSheet( QString() );
264  }
265  else
266  {
267  mDistanceLineEdit->setStyleSheet( QStringLiteral( "font-weight: bold" ) );
268  mDistanceLabel->setStyleSheet( QStringLiteral( "font-weight: bold" ) );
269  }
270 }
271 
272 void QgsAdvancedDigitizingFloater::changeLockAngle( bool locked )
273 {
274  if ( !locked )
275  {
276  mAngleLineEdit->setStyleSheet( QString() );
277  mAngleLabel->setStyleSheet( QString() );
278  }
279  else
280  {
281  mAngleLineEdit->setStyleSheet( QStringLiteral( "font-weight: bold" ) );
282  mAngleLabel->setStyleSheet( QStringLiteral( "font-weight: bold" ) );
283  }
284 }
285 
286 
287 void QgsAdvancedDigitizingFloater::changeRelativeX( bool relative )
288 {
289  if ( !relative )
290  {
291  mXLabel->setText( "x" );
292  }
293  else
294  {
295  mXLabel->setText( "Δx" );
296  }
297  adjustSize();
298 }
299 
300 void QgsAdvancedDigitizingFloater::changeRelativeY( bool relative )
301 {
302  if ( !relative )
303  {
304  mYLabel->setText( "y" );
305  }
306  else
307  {
308  mYLabel->setText( "Δy" );
309  }
310  adjustSize();
311 }
312 
313 void QgsAdvancedDigitizingFloater::changeRelativeZ( bool relative )
314 {
315  if ( !relative )
316  {
317  mZLabel->setText( "z" );
318  }
319  else
320  {
321  mZLabel->setText( "Δz" );
322  }
323  adjustSize();
324 }
325 
326 void QgsAdvancedDigitizingFloater::changeRelativeM( bool relative )
327 {
328  if ( !relative )
329  {
330  mMLabel->setText( "m" );
331  }
332  else
333  {
334  mMLabel->setText( "Δm" );
335  }
336  adjustSize();
337 }
338 
339 // distance is always relative
340 
341 void QgsAdvancedDigitizingFloater::changeRelativeAngle( bool relative )
342 {
343  if ( !relative )
344  {
345  mAngleLabel->setText( "a" );
346  }
347  else
348  {
349  mAngleLabel->setText( "Δa" );
350  }
351  adjustSize();
352 }
353 
354 void QgsAdvancedDigitizingFloater::focusOnX()
355 {
356  if ( mActive )
357  {
358  mXLineEdit->setFocus();
359  mXLineEdit->selectAll();
360  }
361 }
362 
363 void QgsAdvancedDigitizingFloater::focusOnY()
364 {
365  if ( mActive )
366  {
367  mYLineEdit->setFocus();
368  mYLineEdit->selectAll();
369  }
370 }
371 
372 void QgsAdvancedDigitizingFloater::focusOnZ()
373 {
374  if ( mActive )
375  {
376  mZLineEdit->setFocus();
377  mZLineEdit->selectAll();
378  }
379 }
380 
381 void QgsAdvancedDigitizingFloater::focusOnM()
382 {
383  if ( mActive )
384  {
385  mMLineEdit->setFocus();
386  mMLineEdit->selectAll();
387  }
388 }
389 
390 void QgsAdvancedDigitizingFloater::focusOnDistance()
391 {
392  if ( mActive )
393  {
394  mDistanceLineEdit->setFocus();
395  mDistanceLineEdit->selectAll();
396  }
397 }
398 
399 void QgsAdvancedDigitizingFloater::focusOnAngle()
400 {
401  if ( mActive )
402  {
403  mAngleLineEdit->setFocus();
404  mAngleLineEdit->selectAll();
405  }
406 }
407 
408 
409 void QgsAdvancedDigitizingFloater::enabledChangedX( bool enabled )
410 {
411  mXLineEdit->setVisible( enabled );
412  mXLabel->setVisible( enabled );
413  adjustSize();
414 }
415 
416 void QgsAdvancedDigitizingFloater::enabledChangedY( bool enabled )
417 {
418  mYLineEdit->setVisible( enabled );
419  mYLabel->setVisible( enabled );
420  adjustSize();
421 }
422 
423 void QgsAdvancedDigitizingFloater::enabledChangedZ( bool enabled )
424 {
425  mZLineEdit->setVisible( enabled );
426  mZLabel->setVisible( enabled );
427  adjustSize();
428 }
429 
430 void QgsAdvancedDigitizingFloater::enabledChangedM( bool enabled )
431 {
432  mMLineEdit->setVisible( enabled );
433  mMLabel->setVisible( enabled );
434  adjustSize();
435 }
436 
437 void QgsAdvancedDigitizingFloater::enabledChangedDistance( bool enabled )
438 {
439  mDistanceLineEdit->setVisible( enabled );
440  mDistanceLabel->setVisible( enabled );
441  adjustSize();
442 }
443 
444 void QgsAdvancedDigitizingFloater::enabledChangedAngle( bool enabled )
445 {
446  mAngleLineEdit->setVisible( enabled );
447  mAngleLabel->setVisible( enabled );
448  adjustSize();
449 }
The QgsAdvancedDigitizingDockWidget class is a dockable widget used to handle the CAD tools on top of...
void valueDistanceChanged(const QString &value)
Emitted whenever the distance value changes (either the mouse moved, or the user changed the input).
void lockZChanged(bool locked)
Emitted whenever the Z parameter is locked.
void setZ(const QString &value, WidgetSetMode mode)
Set the Z value on the widget.
void setY(const QString &value, WidgetSetMode mode)
Set the Y value on the widget.
void enabledChangedY(bool enabled)
Emitted whenever the Y field is enabled or disabled.
bool cadEnabled() const
determines if CAD tools are enabled or if map tools behaves "nomally"
void relativeMChanged(bool relative)
Emitted whenever the M parameter is toggled between absolute and relative.
void lockXChanged(bool locked)
Emitted whenever the X parameter is locked.
void focusOnXRequested()
Emitted whenever the X field should get the focus using the shortcuts (X).
void enabledChangedX(bool enabled)
Emitted whenever the X field is enabled or disabled.
void valueYChanged(const QString &value)
Emitted whenever the Y value changes (either the mouse moved, or the user changed the input).
void focusOnYRequested()
Emitted whenever the Y field should get the focus using the shortcuts (Y).
void enabledChangedDistance(bool enabled)
Emitted whenever the distance field is enabled or disabled.
void valueZChanged(const QString &value)
Emitted whenever the Z value changes (either the mouse moved, or the user changed the input).
void lockAngleChanged(bool locked)
Emitted whenever the angle parameter is locked.
void relativeXChanged(bool relative)
Emitted whenever the X parameter is toggled between absolute and relative.
void focusOnAngleRequested()
Emitted whenever the angle field should get the focus using the shortcuts (A).
void focusOnZRequested()
Emitted whenever the Z field should get the focus using the shortcuts (Z).
void focusOnMRequested()
Emitted whenever the M field should get the focus using the shortcuts (M).
void valueXChanged(const QString &value)
Emitted whenever the X value changes (either the mouse moved, or the user changed the input).
void lockMChanged(bool locked)
Emitted whenever the M parameter is locked.
void cadEnabledChanged(bool enabled)
Signals for external widgets that need to update according to current values.
void lockYChanged(bool locked)
Emitted whenever the Y parameter is locked.
void valueAngleChanged(const QString &value)
Emitted whenever the angle value changes (either the mouse moved, or the user changed the input).
void valueMChanged(const QString &value)
Emitted whenever the M value changes (either the mouse moved, or the user changed the input).
void relativeZChanged(bool relative)
Emitted whenever the Z parameter is toggled between absolute and relative.
void setAngle(const QString &value, WidgetSetMode mode)
Set the angle value on the widget.
void enabledChangedAngle(bool enabled)
Emitted whenever the angle field is enabled or disabled.
void enabledChangedZ(bool enabled)
Emitted whenever the Z field is enabled or disabled.
void lockDistanceChanged(bool locked)
Emitted whenever the distance parameter is locked.
void relativeAngleChanged(bool relative)
Emitted whenever the angleX parameter is toggled between absolute and relative.
void enabledChangedM(bool enabled)
Emitted whenever the M field is enabled or disabled.
void setDistance(const QString &value, WidgetSetMode mode)
Set the distance value on the widget.
void setX(const QString &value, WidgetSetMode mode)
Set the X value on the widget.
void focusOnDistanceRequested()
Emitted whenever the distance field should get the focus using the shortcuts (D).
void setM(const QString &value, WidgetSetMode mode)
Set the M value on the widget.
void relativeYChanged(bool relative)
Emitted whenever the Y parameter is toggled between absolute and relative.
QgsAdvancedDigitizingFloater(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Create an advanced digitizing floater widget.
void setActive(bool active)
Set whether the floater should be active or not.
bool active()
Whether the floater is active or not.
A event filter for watching for focus events on a parent object.
void focusOut()
Emitted when parent object loses focus.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:89
This class is a composition of two QSettings instances:
Definition: qgssettings.h:62
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.