QGIS API Documentation  3.23.0-Master (eb871beae0)
qgsadvanceddigitizingfloater.h
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 #ifndef QGSADVANCEDDIGITIZINGFLOATER
17 #define QGSADVANCEDDIGITIZINGFLOATER
18 
19 #include <QWidget>
20 #include <QString>
21 
22 #include "ui_qgsadvanceddigitizingfloaterbase.h"
24 #include "qgis_gui.h"
25 #include "qgis_sip.h"
26 
27 class QgsMapCanvas;
29 
38 class GUI_EXPORT QgsAdvancedDigitizingFloater : public QWidget, private Ui::QgsAdvancedDigitizingFloaterBase
39 {
40  Q_OBJECT
41 
42  public:
43 
51 
57  bool active();
58 
59  public slots:
60 
68  void setActive( bool active );
69 
70  private slots:
71 
72  void changeX( const QString &text );
73  void changeY( const QString &text );
74  void changeZ( const QString &text );
75  void changeM( const QString &text );
76  void changeDistance( const QString &text );
77  void changeAngle( const QString &text );
78  void changeLockX( bool locked );
79  void changeLockY( bool locked );
80  void changeLockZ( bool locked );
81  void changeLockM( bool locked );
82  void changeLockDistance( bool locked );
83  void changeLockAngle( bool locked );
84  void changeRelativeX( bool relative );
85  void changeRelativeY( bool relative );
86  void changeRelativeZ( bool relative );
87  void changeRelativeM( bool relative );
88  // void changeRelativeDistance( bool relative ); // doesn't happen
89  void changeRelativeAngle( bool relative );
90  void focusOnX();
91  void focusOnY();
92  void focusOnZ();
93  void focusOnM();
94  void focusOnAngle();
95  void focusOnDistance();
96  void enabledChangedX( bool enabled );
97  void enabledChangedY( bool enabled );
98  void enabledChangedZ( bool enabled );
99  void enabledChangedM( bool enabled );
100  void enabledChangedAngle( bool enabled );
101  void enabledChangedDistance( bool enabled );
102 
103  private:
104 
106  QgsMapCanvas *mMapCanvas = nullptr;
107 
109  QgsAdvancedDigitizingDockWidget *mCadDockWidget = nullptr;
110 
115  bool eventFilter( QObject *obj, QEvent *event ) override SIP_FORCE;
116 
121  void updatePos( const QPoint &pos );
122 
126  void hideIfDisabled();
127 
129  bool mActive = false;
130 };
131 
132 #endif // QGSADVANCEDDIGITIZINGFLOATER_H
The QgsAdvancedDigitizingDockWidget class is a dockable widget used to handle the CAD tools on top of...
The QgsAdvancedDigitizingFloater class is widget that floats next to the mouse pointer,...
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:89
#define SIP_FORCE
Definition: qgis_sip.h:131