QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 changeDistance( const QString &text );
75  void changeAngle( const QString &text );
76  void changeLockX( bool locked );
77  void changeLockY( bool locked );
78  void changeLockDistance( bool locked );
79  void changeLockAngle( bool locked );
80  void changeRelativeX( bool relative );
81  void changeRelativeY( bool relative );
82  // void changeRelativeDistance( bool relative ); // doesn't happen
83  void changeRelativeAngle( bool relative );
84  void focusOnX();
85  void focusOnY();
86  void focusOnAngle();
87  void focusOnDistance();
88  void enabledChangedX( bool enabled );
89  void enabledChangedY( bool enabled );
90  void enabledChangedAngle( bool enabled );
91  void enabledChangedDistance( bool enabled );
92 
93  private:
94 
96  QgsMapCanvas *mMapCanvas = nullptr;
97 
99  QgsAdvancedDigitizingDockWidget *mCadDockWidget = nullptr;
100 
105  bool eventFilter( QObject *obj, QEvent *event ) override SIP_FORCE;
106 
111  void updatePos( const QPoint &pos );
112 
116  void hideIfDisabled();
117 
119  bool mActive = false;
120 };
121 
122 #endif // QGSADVANCEDDIGITIZINGFLOATER_H
QgsMapCanvas
Definition: qgsmapcanvas.h:83
qgis_sip.h
QgsAdvancedDigitizingDockWidget
The QgsAdvancedDigitizingDockWidget class is a dockable widget used to handle the CAD tools on top of...
Definition: qgsadvanceddigitizingdockwidget.h:48
qgsadvanceddigitizingdockwidget.h
SIP_FORCE
#define SIP_FORCE
Definition: qgis_sip.h:131
QgsAdvancedDigitizingFloater
The QgsAdvancedDigitizingFloater class is widget that floats next to the mouse pointer,...
Definition: qgsadvanceddigitizingfloater.h:38