QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
Handles logic relating to synchronizing online and offline copies of layer data. More...
#include <qgsofflineediting.h>
Public Types | |
enum | ContainerType { SpatiaLite , GPKG } |
Type of offline database container file. More... | |
enum | ProgressMode { CopyFeatures = 0 , ProcessFeatures , AddFields , AddFeatures , RemoveFeatures , UpdateFeatures , UpdateGeometries } |
Signals | |
void | layerProgressUpdated (int layer, int numLayers) |
Emitted whenever a new layer is being processed. | |
void | progressModeSet (QgsOfflineEditing::ProgressMode mode, long long maximum) |
Emitted when the mode for the progress of the current operation is set. | |
void | progressStarted () |
Emitted when the process has started. | |
void | progressStopped () |
Emitted when the processing of all layers has finished. | |
void | progressUpdated (long long progress) |
Emitted with the progress of the current mode. | |
void | warning (const QString &title, const QString &message) |
Emitted when a warning needs to be displayed. | |
Public Member Functions | |
QgsOfflineEditing () | |
bool | convertToOfflineProject (const QString &offlineDataPath, const QString &offlineDbFile, const QStringList &layerIds, bool onlySelected=false, ContainerType containerType=SpatiaLite, const QString &layerNameSuffix=QStringLiteral(" (offline)")) |
Convert current project for offline editing. | |
bool | isOfflineProject () const |
Returns true if current project is offline. | |
void | synchronize (bool useTransaction=false) |
Synchronize to remote layers. | |
Handles logic relating to synchronizing online and offline copies of layer data.
Definition at line 36 of file qgsofflineediting.h.
Type of offline database container file.
Enumerator | |
---|---|
SpatiaLite | |
GPKG |
Definition at line 53 of file qgsofflineediting.h.
Enumerator | |
---|---|
CopyFeatures | |
ProcessFeatures | |
AddFields | |
AddFeatures | |
RemoveFeatures | |
UpdateFeatures | |
UpdateGeometries |
Definition at line 41 of file qgsofflineediting.h.
QgsOfflineEditing::QgsOfflineEditing | ( | ) |
Definition at line 67 of file qgsofflineediting.cpp.
bool QgsOfflineEditing::convertToOfflineProject | ( | const QString & | offlineDataPath, |
const QString & | offlineDbFile, | ||
const QStringList & | layerIds, | ||
bool | onlySelected = false , |
||
ContainerType | containerType = SpatiaLite , |
||
const QString & | layerNameSuffix = QStringLiteral( " (offline)" ) |
||
) |
Convert current project for offline editing.
convert current project to offline project returns offline project file path
offlineDataPath | Path to offline db file |
offlineDbFile | Offline db file name |
layerIds | List of layer names to convert |
onlySelected | Only copy selected features from layers where a selection is present |
containerType | defines the SQLite file container type like SpatiaLite or GPKG |
layerNameSuffix | Suffix string added to the offline layer name |
Workflow:
Definition at line 84 of file qgsofflineediting.cpp.
bool QgsOfflineEditing::isOfflineProject | ( | ) | const |
Returns true
if current project is offline.
Definition at line 139 of file qgsofflineediting.cpp.
|
signal |
Emitted whenever a new layer is being processed.
It is possible to estimate the progress of the complete operation by comparing the index of the current layer to the total amount numLayers.
|
signal |
Emitted when the mode for the progress of the current operation is set.
mode | progress mode |
maximum | total number of entities to process in the current operation |
|
signal |
Emitted when the process has started.
|
signal |
Emitted when the processing of all layers has finished.
|
signal |
Emitted with the progress of the current mode.
progress | current index of processed entities |
void QgsOfflineEditing::synchronize | ( | bool | useTransaction = false | ) |
Synchronize to remote layers.
useTransaction | enforce the remote layer modifications with the same source to be in a transaction group |
Definition at line 144 of file qgsofflineediting.cpp.
|
signal |
Emitted when a warning needs to be displayed.
title | title string for message |
message | A descriptive message for the warning |