QGIS API Documentation  2.99.0-Master (6a61179)
Classes | Public Types | Signals | Public Member Functions | List of all members
QgsOfflineEditing Class Reference

#include <qgsofflineediting.h>

Inheritance diagram for QgsOfflineEditing:
Inheritance graph
[legend]

Public Types

enum  ProgressMode {
  CopyFeatures = 0, ProcessFeatures, AddFields, AddFeatures,
  RemoveFeatures, UpdateFeatures, UpdateGeometries
}
 

Signals

void layerProgressUpdated (int layer, int numLayers)
 Emit a signal that the next layer of numLayers has started processing. More...
 
void progressModeSet (QgsOfflineEditing::ProgressMode mode, int maximum)
 Emit a signal that sets the mode for the progress of the current operation. More...
 
void progressStarted ()
 Emit a signal that processing has started. More...
 
void progressStopped ()
 Emit a signal that processing of all layers has finished. More...
 
void progressUpdated (int progress)
 Emit a signal with the progress of the current mode. More...
 
void warning (const QString &title, const QString &message)
 Emitted when a warning needs to be displayed. More...
 

Public Member Functions

 QgsOfflineEditing ()
 
 ~QgsOfflineEditing ()
 
bool convertToOfflineProject (const QString &offlineDataPath, const QString &offlineDbFile, const QStringList &layerIds, bool onlySelected=false)
 Convert current project for offline editing. More...
 
bool isOfflineProject () const
 Return true if current project is offline. More...
 
void synchronize ()
 Synchronize to remote layers. More...
 

Detailed Description

Definition at line 34 of file qgsofflineediting.h.

Member Enumeration Documentation

§ ProgressMode

Enumerator
CopyFeatures 
ProcessFeatures 
AddFields 
AddFeatures 
RemoveFeatures 
UpdateFeatures 
UpdateGeometries 

Definition at line 39 of file qgsofflineediting.h.

Constructor & Destructor Documentation

§ QgsOfflineEditing()

QgsOfflineEditing::QgsOfflineEditing ( )

Definition at line 59 of file qgsofflineediting.cpp.

§ ~QgsOfflineEditing()

QgsOfflineEditing::~QgsOfflineEditing ( )

Definition at line 64 of file qgsofflineediting.cpp.

Member Function Documentation

§ convertToOfflineProject()

bool QgsOfflineEditing::convertToOfflineProject ( const QString &  offlineDataPath,
const QString &  offlineDbFile,
const QStringList &  layerIds,
bool  onlySelected = false 
)

Convert current project for offline editing.

convert current project to offline project returns offline project file path

Parameters
offlineDataPathPath to offline db file
offlineDbFileOffline db file name
layerIdsList of layer names to convert
onlySelectedOnly copy selected features from layers where a selection is present

Workflow:

  • copy layers to spatialite
  • create spatialite db at offlineDataPath
  • create table for each layer
  • add new spatialite layer
  • copy features
  • save as offline project
  • mark offline layers
  • remove remote layers
  • mark as offline project

Definition at line 83 of file qgsofflineediting.cpp.

§ isOfflineProject()

bool QgsOfflineEditing::isOfflineProject ( ) const

Return true if current project is offline.

Definition at line 201 of file qgsofflineediting.cpp.

§ layerProgressUpdated

void QgsOfflineEditing::layerProgressUpdated ( int  layer,
int  numLayers 
)
signal

Emit a signal that the next layer of numLayers has started processing.

Parameters
layercurrent layer index
numLayerstotal number of layers

§ progressModeSet

void QgsOfflineEditing::progressModeSet ( QgsOfflineEditing::ProgressMode  mode,
int  maximum 
)
signal

Emit a signal that sets the mode for the progress of the current operation.

Parameters
modeprogress mode
maximumtotal number of entities to process in the current operation

§ progressStarted

void QgsOfflineEditing::progressStarted ( )
signal

Emit a signal that processing has started.

§ progressStopped

void QgsOfflineEditing::progressStopped ( )
signal

Emit a signal that processing of all layers has finished.

§ progressUpdated

void QgsOfflineEditing::progressUpdated ( int  progress)
signal

Emit a signal with the progress of the current mode.

Parameters
progresscurrent index of processed entities

§ synchronize()

void QgsOfflineEditing::synchronize ( )

Synchronize to remote layers.

Definition at line 206 of file qgsofflineediting.cpp.

§ warning

void QgsOfflineEditing::warning ( const QString &  title,
const QString &  message 
)
signal

Emitted when a warning needs to be displayed.

Parameters
titletitle string for message
messageA descriptive message for the warning

The documentation for this class was generated from the following files: