QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
qgsprojectgpssettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprojectgpssettings.h
3 ---------------------------
4 begin : November 2022
5 copyright : (C) 2022 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
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#ifndef QGSPROJECTGPSSETTINGS_H
16#define QGSPROJECTGPSSETTINGS_H
17
18#include "qgis_core.h"
19#include "qgis_sip.h"
20#include "qgis.h"
21#include "qgsvectorlayerref.h"
22
23#include <QObject>
24
25class QDomElement;
27class QDomDocument;
28
36class CORE_EXPORT QgsProjectGpsSettings : public QObject
37{
38 Q_OBJECT
39
40 public:
41
42 Q_PROPERTY( bool automaticallyAddTrackVertices READ automaticallyAddTrackVertices WRITE setAutomaticallyAddTrackVertices NOTIFY automaticallyAddTrackVerticesChanged )
43 Q_PROPERTY( bool automaticallyCommitFeatures READ automaticallyCommitFeatures WRITE setAutomaticallyCommitFeatures NOTIFY automaticallyCommitFeaturesChanged )
44 Q_PROPERTY( QgsVectorLayer *destinationLayer READ destinationLayer WRITE setDestinationLayer NOTIFY destinationLayerChanged )
45
49 QgsProjectGpsSettings( QObject *parent = nullptr );
50
52
56 void resolveReferences( const QgsProject *project );
57
61 void reset();
62
67 bool readXml( const QDomElement &element, const QgsReadWriteContext &context );
68
73 QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
74
82 bool automaticallyAddTrackVertices() const;
83
92 bool automaticallyCommitFeatures() const;
93
101 bool destinationFollowsActiveLayer() const;
102
112 QgsVectorLayer *destinationLayer() const;
113
121 QMap< QString, QString > destinationTimeStampFields() const;
122
130 QString destinationTimeStampField() const;
131
132 public slots:
133
141 void setAutomaticallyAddTrackVertices( bool enabled );
142
151 void setAutomaticallyCommitFeatures( bool enabled );
152
160 void setDestinationFollowsActiveLayer( bool follow );
161
171 void setDestinationLayer( QgsVectorLayer *layer );
172
183 void setDestinationTimeStampField( QgsVectorLayer *layer, const QString &field );
184
185 signals:
186
194 void automaticallyAddTrackVerticesChanged( bool enabled );
195
203 void automaticallyCommitFeaturesChanged( bool enabled );
204
212 void destinationFollowsActiveLayerChanged( bool follows );
213
221 void destinationLayerChanged( QgsVectorLayer *layer );
222
234 void destinationTimeStampFieldChanged( const QString &field );
235
236 private:
237
238 bool mAutoAddTrackVertices = false;
239 bool mAutoCommitFeatures = false;
240
241 bool mDestinationFollowsActiveLayer = true;
242 QgsVectorLayerRef mDestinationLayer;
243
244 QMap<QString, QString> mDestinationTimestampFields;
245
246};
247
248#endif // QGSPROJECTGPSSETTINGS_H
Contains settings and properties relating to how a QgsProject should interact with a GPS device.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:107
The class is used as a container of context for various read/write operations on other objects.
Represents a vector layer which manages a vector based data sets.