Skip to content

Class TrackingModel

ClassList > TrackingModel

Inherits the following classes: QAbstractItemModel

Public Types

Type Name
enum TrackingRoles

Public Signals

Type Name
signal void layerInTrackingChanged (QgsVectorLayer * layer, bool tracking)
signal void trackingSetupRequested (QModelIndex trackerIndex, bool skipSettings)

Public Functions

Type Name
TrackingModel (QObject * parent=nullptr)
Q_INVOKABLE QList< QgsVectorLayer * > availableLayers (QgsProject * project) const
Q_INVOKABLE QgsVectorLayer * bestAvailableLayer (QgsProject * project) const
int columnCount (const QModelIndex & parent=QModelIndex()) override const
Q_INVOKABLE void createProjectTrackers (QgsProject * project)
Creates tracking sessions defined in a project being opened.
Q_INVOKABLE QModelIndex createTracker (QgsVectorLayer * layer)
Creates a tracking session for the provided vector layer .
QVariant data (const QModelIndex & index, int role=Qt::DisplayRole) override const
Q_INVOKABLE bool featureInTracking (QgsVectorLayer * layer, QgsFeatureId featureId)
Returns TRUE if the featureId is attached to a vector__layer tracking session.
Q_INVOKABLE bool featuresInTracking (QgsVectorLayer * layer, const QList< QgsFeature > & features)
Returns TRUE if the list of features is attached to a vector__layer tracking session.
QModelIndex index (int row, int column, const QModelIndex & parent=QModelIndex()) override const
Q_INVOKABLE bool layerInActiveTracking (QgsVectorLayer * layer) const
Returns TRUE if the vector layer has an active tracking session.
Q_INVOKABLE bool layerInTracking (QgsVectorLayer * layer) const
Returns TRUE if the vector layer has a tracking session.
QModelIndex parent (const QModelIndex & index) override const
Q_INVOKABLE void replayPositionInformationList (const QList< GnssPositionInformation > & positionInformationList, QgsQuickCoordinateTransformer * coordinateTransformer=nullptr)
Replays a list of position information for all active trackers.
Q_INVOKABLE void requestTrackingSetup (QgsVectorLayer * layer, bool skipSettings=false)
void reset ()
QHash< int, QByteArray > roleNames () override const
int rowCount (const QModelIndex & parent=QModelIndex()) override const
virtual bool setData (const QModelIndex & index, const QVariant & value, int role) override
Q_INVOKABLE void setTrackerVisibility (QgsVectorLayer * layer, bool visible)
Sets whether the tracking session rubber band is visible .
Q_INVOKABLE void startTracker (QgsVectorLayer * layer, const GnssPositionInformation & positionInformation=GnssPositionInformation(), const QgsPoint & projectedPosition=QgsPoint())
Starts tracking for the provided vector layer provided it has a tracking session created.
Q_INVOKABLE void stopTracker (QgsVectorLayer * layer)
Stops the tracking session of the provided vector layer .
Q_INVOKABLE void stopTrackers ()
Stops all tracking sessions.
Q_INVOKABLE void suspendUntilReplay ()
Q_INVOKABLE Tracker * trackerForLayer (QgsVectorLayer * layer) const
Returns the tracker for the vector layer if a tracking session is present, otherwise returns NULLPTR.
Q_INVOKABLE void trackingSetupDone ()
~TrackingModel () override

Public Types Documentation

enum TrackingRoles

enum TrackingModel::TrackingRoles {
    DisplayString = Qt::UserRole,
    TrackerPointer
};

Public Signals Documentation

signal layerInTrackingChanged

void TrackingModel::layerInTrackingChanged;

signal trackingSetupRequested

void TrackingModel::trackingSetupRequested;

Public Functions Documentation

function TrackingModel

explicit TrackingModel::TrackingModel (
    QObject * parent=nullptr
) 

function availableLayers

Q_INVOKABLE QList< QgsVectorLayer * > TrackingModel::availableLayers (
    QgsProject * project
) const

Returns a list of available project vector layers with which a tracking session can be started.


function bestAvailableLayer

Q_INVOKABLE QgsVectorLayer * TrackingModel::bestAvailableLayer (
    QgsProject * project
) const

Returns the best available project vector layer with which a tracking session can be started.


function columnCount

int TrackingModel::columnCount (
    const QModelIndex & parent=QModelIndex()
) override const

function createProjectTrackers

Creates tracking sessions defined in a project being opened.

Q_INVOKABLE void TrackingModel::createProjectTrackers (
    QgsProject * project
) 

function createTracker

Creates a tracking session for the provided vector layer .

Q_INVOKABLE QModelIndex TrackingModel::createTracker (
    QgsVectorLayer * layer
) 

function data

QVariant TrackingModel::data (
    const QModelIndex & index,
    int role=Qt::DisplayRole
) override const

function featureInTracking

Returns TRUE if the featureId is attached to a vector__layer tracking session.

Q_INVOKABLE bool TrackingModel::featureInTracking (
    QgsVectorLayer * layer,
    QgsFeatureId featureId
) 

function featuresInTracking

Returns TRUE if the list of features is attached to a vector__layer tracking session.

Q_INVOKABLE bool TrackingModel::featuresInTracking (
    QgsVectorLayer * layer,
    const QList< QgsFeature > & features
) 

function index

QModelIndex TrackingModel::index (
    int row,
    int column,
    const QModelIndex & parent=QModelIndex()
) override const

function layerInActiveTracking

Returns TRUE if the vector layer has an active tracking session.

Q_INVOKABLE bool TrackingModel::layerInActiveTracking (
    QgsVectorLayer * layer
) const

function layerInTracking

Returns TRUE if the vector layer has a tracking session.

Q_INVOKABLE bool TrackingModel::layerInTracking (
    QgsVectorLayer * layer
) const

function parent

QModelIndex TrackingModel::parent (
    const QModelIndex & index
) override const

function replayPositionInformationList

Replays a list of position information for all active trackers.

Q_INVOKABLE void TrackingModel::replayPositionInformationList (
    const QList< GnssPositionInformation > & positionInformationList,
    QgsQuickCoordinateTransformer * coordinateTransformer=nullptr
) 

function requestTrackingSetup

Q_INVOKABLE void TrackingModel::requestTrackingSetup (
    QgsVectorLayer * layer,
    bool skipSettings=false
) 

Forwards a tracking setup request to the user interface consisting of a settings panel followed by a feature form (unless suppressed by the project configuration). layer the vector layer associated with the tracking skipSettings set to TRUE if the settings panel should be omitted and only show the feature form


function reset

void TrackingModel::reset () 

function roleNames

QHash< int, QByteArray > TrackingModel::roleNames () override const

function rowCount

int TrackingModel::rowCount (
    const QModelIndex & parent=QModelIndex()
) override const

function setData

virtual bool TrackingModel::setData (
    const QModelIndex & index,
    const QVariant & value,
    int role
) override

function setTrackerVisibility

Sets whether the tracking session rubber band is visible .

Q_INVOKABLE void TrackingModel::setTrackerVisibility (
    QgsVectorLayer * layer,
    bool visible
) 

function startTracker

Starts tracking for the provided vector layer provided it has a tracking session created.

Q_INVOKABLE void TrackingModel::startTracker (
    QgsVectorLayer * layer,
    const GnssPositionInformation & positionInformation=GnssPositionInformation (),
    const QgsPoint & projectedPosition=QgsPoint()
) 

function stopTracker

Stops the tracking session of the provided vector layer .

Q_INVOKABLE void TrackingModel::stopTracker (
    QgsVectorLayer * layer
) 

function stopTrackers

Stops all tracking sessions.

Q_INVOKABLE void TrackingModel::stopTrackers () 

function suspendUntilReplay

Q_INVOKABLE void TrackingModel::suspendUntilReplay () 

function trackerForLayer

Returns the tracker for the vector layer if a tracking session is present, otherwise returns NULLPTR.

Q_INVOKABLE Tracker * TrackingModel::trackerForLayer (
    QgsVectorLayer * layer
) const

function trackingSetupDone

Q_INVOKABLE void TrackingModel::trackingSetupDone () 

function ~TrackingModel

TrackingModel::~TrackingModel () override


The documentation for this class was generated from the following file src/core/trackingmodel.h