Class QfProjectInfo
#include <qfprojectinfo.h>
Inherits the following classes: QObject
Public Properties
| Type | Name |
|---|---|
| property QgsMapLayer * | activeLayer |
| property QfCloudUserInformation | cloudUserInformation |
| property QString | filePath |
| property QfFlatLayerTreeModel * | layerTree |
| property QgsQuickMapSettings * | mapSettings |
| property bool | snappingEnabled |
| property QString | stateMode |
| property QfTrackingModel * | trackingModel |
Public Signals
| Type | Name |
|---|---|
| signal void | activeLayerChanged |
| signal void | cloudUserInformationChanged |
| signal void | filePathChanged |
| signal void | layerTreeChanged |
| signal void | mapSettingsChanged |
| signal void | snappingEnabledChanged |
| signal void | stateModeChanged |
| signal void | trackingModelChanged |
Public Functions
| Type | Name |
|---|---|
| QfProjectInfo (QObject * parent=nullptr) |
|
| QgsMapLayer * | activeLayer () const |
| QfCloudUserInformation | cloudUserInformation () const |
| QString | filePath () const |
| Q_INVOKABLE QVariantMap | getCopyrightDecorationConfiguration () Retrieves configuration of the copyright decoration. |
| Q_INVOKABLE QgsMapLayer * | getDefaultActiveLayerForMapTheme (const QString & mapTheme) Retrieves the default active layer for a given map theme. |
| Q_INVOKABLE QVariantMap | getGridDecorationConfiguration () Retrieves configuration of the grid decoration. |
| Q_INVOKABLE QVariantMap | getImageDecorationConfiguration () Retrieves configuration of the image decoration. |
| Q_INVOKABLE QVariantMap | getTitleDecorationConfiguration () Retrieves configuration of the title decoration. |
| QfFlatLayerTreeModel * | layerTree () const |
| QgsQuickMapSettings * | mapSettings () const |
| Q_INVOKABLE void | restoreCloudUserInformation () |
| Q_INVOKABLE QModelIndex | restoreTracker (QgsVectorLayer * layer) Restore the last tracking session that occured within a vector layer . |
| Q_INVOKABLE void | saveLayerRememberedFields (QgsMapLayer * layer) |
| Q_INVOKABLE void | saveLayerSnappingConfiguration (QgsMapLayer * layer) |
| Q_INVOKABLE void | saveLayerStyle (QgsMapLayer * layer) |
| Q_INVOKABLE void | saveLayerTreeState () |
| Q_INVOKABLE void | saveTracker (QgsVectorLayer * layer) Save an ongoing vector layer tracking session details. |
| Q_INVOKABLE void | saveVariable (const QString & name, const QString & value) |
| void | setActiveLayer (QgsMapLayer * layer) |
| void | setCloudUserInformation (const QfCloudUserInformation & cloudUserInformation) |
| void | setFilePath (const QString & filePath) |
| void | setLayerTree (QfFlatLayerTreeModel * layerTree) |
| void | setMapSettings (QgsQuickMapSettings * mapSettings) |
| void | setSnappingEnabled (bool enabled) |
| void | setStateMode (const QString & mode) |
| void | setTrackingModel (QfTrackingModel * trackingModel) |
| bool | snappingEnabled () const |
| QString | stateMode () const |
| QfTrackingModel * | trackingModel () const |
| virtual | ~QfProjectInfo () = default |
Public Static Functions
| Type | Name |
|---|---|
| void | restoreSettings (QString & projectFilePath, QgsProject * project, QgsQuickMapCanvasMap * mapCanvas, QfFlatLayerTreeModel * layerTree) Restore various project settings. |
Detailed Description
This class stores current projection information such as extent and map theme in order for those to be saved and afterwards restored when the project is re-opened.
Public Properties Documentation
property activeLayer [1/2]
QgsMapLayer * QfProjectInfo::activeLayer;
The active layer for the currently opened project.
property cloudUserInformation [1/2]
QfCloudUserInformation QfProjectInfo::cloudUserInformation;
Set cloud user information for offline usage.
property filePath [1/2]
QString QfProjectInfo::filePath;
The file path associated with the currently opened project.
property layerTree [1/2]
QfFlatLayerTreeModel * QfProjectInfo::layerTree;
The layer tree model object, used to keep track of details such as layer visibility, selected map theme, etc.
property mapSettings [1/2]
QgsQuickMapSettings * QfProjectInfo::mapSettings;
The map settings object, used to keep track of details such as the map extent.
property snappingEnabled [1/2]
bool QfProjectInfo::snappingEnabled;
The snapping enabled state for the currently opened project.
property stateMode [1/2]
QString QfProjectInfo::stateMode;
The state mode (browse vs. digitizing) for the currently opened project.
property trackingModel [1/2]
QfTrackingModel * QfProjectInfo::trackingModel;
The tracking model object, used to save and restore tracking session for individual vector layers.
Public Signals Documentation
signal activeLayerChanged
void QfProjectInfo::activeLayerChanged;
signal cloudUserInformationChanged
void QfProjectInfo::cloudUserInformationChanged;
signal filePathChanged
void QfProjectInfo::filePathChanged;
signal layerTreeChanged
void QfProjectInfo::layerTreeChanged;
signal mapSettingsChanged
void QfProjectInfo::mapSettingsChanged;
signal snappingEnabledChanged
void QfProjectInfo::snappingEnabledChanged;
signal stateModeChanged
void QfProjectInfo::stateModeChanged;
signal trackingModelChanged
void QfProjectInfo::trackingModelChanged;
Public Functions Documentation
function QfProjectInfo
explicit QfProjectInfo::QfProjectInfo (
QObject * parent=nullptr
)
function activeLayer [2/2]
QgsMapLayer * QfProjectInfo::activeLayer () const
Returns the saved active layer for the current project or nullptr if active layer was not saved or isn't present
function cloudUserInformation [2/2]
QfCloudUserInformation QfProjectInfo::cloudUserInformation () const
Returns the saved cloud user infomation for offline usage
function filePath [2/2]
QString QfProjectInfo::filePath () const
The file path associated with the currently opened project.
function getCopyrightDecorationConfiguration
Retrieves configuration of the copyright decoration.
Q_INVOKABLE QVariantMap QfProjectInfo::getCopyrightDecorationConfiguration ()
function getDefaultActiveLayerForMapTheme
Retrieves the default active layer for a given map theme.
Q_INVOKABLE QgsMapLayer * QfProjectInfo::getDefaultActiveLayerForMapTheme (
const QString & mapTheme
)
function getGridDecorationConfiguration
Retrieves configuration of the grid decoration.
Q_INVOKABLE QVariantMap QfProjectInfo::getGridDecorationConfiguration ()
function getImageDecorationConfiguration
Retrieves configuration of the image decoration.
Q_INVOKABLE QVariantMap QfProjectInfo::getImageDecorationConfiguration ()
function getTitleDecorationConfiguration
Retrieves configuration of the title decoration.
Q_INVOKABLE QVariantMap QfProjectInfo::getTitleDecorationConfiguration ()
function layerTree [2/2]
QfFlatLayerTreeModel * QfProjectInfo::layerTree () const
The layer tree model object, used to keep track of details such as layer visibility, selected map theme, etc.
function mapSettings [2/2]
QgsQuickMapSettings * QfProjectInfo::mapSettings () const
The map settings object, used to keep track of details such as the map extent.
function restoreCloudUserInformation
Q_INVOKABLE void QfProjectInfo::restoreCloudUserInformation ()
Restores last saved cloud user information details attached to the current project
function restoreTracker
Restore the last tracking session that occured within a vector layer .
Q_INVOKABLE QModelIndex QfProjectInfo::restoreTracker (
QgsVectorLayer * layer
)
function saveLayerRememberedFields
Q_INVOKABLE void QfProjectInfo::saveLayerRememberedFields (
QgsMapLayer * layer
)
Saves the vector layer fields that are remembered during feature additions
function saveLayerSnappingConfiguration
Q_INVOKABLE void QfProjectInfo::saveLayerSnappingConfiguration (
QgsMapLayer * layer
)
Saves the current snapping configuration settings
function saveLayerStyle
Q_INVOKABLE void QfProjectInfo::saveLayerStyle (
QgsMapLayer * layer
)
Saves the layer style to the current project information settings
function saveLayerTreeState
Q_INVOKABLE void QfProjectInfo::saveLayerTreeState ()
Saves the current state (visibility and collapse status) of the layer tree
function saveTracker
Save an ongoing vector layer tracking session details.
Q_INVOKABLE void QfProjectInfo::saveTracker (
QgsVectorLayer * layer
)
function saveVariable
Q_INVOKABLE void QfProjectInfo::saveVariable (
const QString & name,
const QString & value
)
function setActiveLayer
void QfProjectInfo::setActiveLayer (
QgsMapLayer * layer
)
Saves the active layer within the current project
function setCloudUserInformation
void QfProjectInfo::setCloudUserInformation (
const QfCloudUserInformation & cloudUserInformation
)
Saves the cloud user infomation for offline usage
function setFilePath
void QfProjectInfo::setFilePath (
const QString & filePath
)
The file path associated with the currently opened project.
function setLayerTree
void QfProjectInfo::setLayerTree (
QfFlatLayerTreeModel * layerTree
)
The layer tree model object, used to keep track of details such as layer visibility, selected map theme, etc.
function setMapSettings
void QfProjectInfo::setMapSettings (
QgsQuickMapSettings * mapSettings
)
The map settings object, used to keep track of details such as the map extent.
function setSnappingEnabled
void QfProjectInfo::setSnappingEnabled (
bool enabled
)
Saves the snapping enabled state for the current project
function setStateMode
void QfProjectInfo::setStateMode (
const QString & mode
)
Saves the state mode for the current project
function setTrackingModel
void QfProjectInfo::setTrackingModel (
QfTrackingModel * trackingModel
)
The tracking model object, used to save and restore tracking session for individual vector layers.
function snappingEnabled [2/2]
bool QfProjectInfo::snappingEnabled () const
Returns the saved snapping enabed state for the current project
function stateMode [2/2]
QString QfProjectInfo::stateMode () const
Returns the saved state mode for the current project
function trackingModel [2/2]
QfTrackingModel * QfProjectInfo::trackingModel () const
The tracking model object, used to save and restore tracking session for individual vector layers.
function ~QfProjectInfo
virtual QfProjectInfo::~QfProjectInfo () = default
Public Static Functions Documentation
function restoreSettings
Restore various project settings.
static void QfProjectInfo::restoreSettings (
QString & projectFilePath,
QgsProject * project,
QgsQuickMapCanvasMap * mapCanvas,
QfFlatLayerTreeModel * layerTree
)
The documentation for this class was generated from the following file src/core/qfprojectinfo.h