QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
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
46
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
195
204
213
222
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.
void destinationFollowsActiveLayerChanged(bool follows)
Emitted whenever the destinationFollowsActiveLayer() setting is changed.
void destinationLayerChanged(QgsVectorLayer *layer)
Emitted whenever the destination layer for features digitized from GPS is changed.
void destinationTimeStampFieldChanged(const QString &field)
Emitted whenever the destination field for automatic time stamps is changed.
~QgsProjectGpsSettings() override
void automaticallyCommitFeaturesChanged(bool enabled)
Emitted whenever the automaticallyCommitFeatures() setting is changed.
void automaticallyAddTrackVerticesChanged(bool enabled)
Emitted whenever the automaticallyAddTrackVertices() setting is changed.
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.
const QgsField & field
Definition: qgsfield.h:554