Skip to content

Class QgisMobileapp

ClassList > QgisMobileapp

Inherits the following classes: QQmlApplicationEngine

Public Signals

Type Name
signal void loadProjectEnded (const QString & filename, const QString & name)
signal void loadProjectTriggered (const QString & filename, const QString & name)
signal void setMapExtent (const QgsRectangle & extent)

Public Functions

Type Name
QgisMobileapp (QgsApplication * app, QObject * parent=nullptr)
void clearProject ()
bool event (QEvent * event) override
bool loadProjectFile (const QString & path, const QString & name=QString())
bool print (const QString & layoutName)
bool printAtlasFeatures (const QString & layoutName, const QList< long long > & featureIds)
bool readProjectBoolEntry (const QString & scope, const QString & key, bool def=false) const
double readProjectDoubleEntry (const QString & scope, const QString & key, double def=0.0) const
QString readProjectEntry (const QString & scope, const QString & key, const QString & def=QString()) const
void readProjectFile ()
int readProjectNumEntry (const QString & scope, const QString & key, int def=0) const
QList< QPair< QString, QString > > recentProjects ()
void reloadProjectFile ()
void removeRecentProject (const QString & path)
void saveRecentProjects (const QList< QPair< QString, QString > > & projects)
void setScreenDimmerTimeout (int timeoutSeconds)
~QgisMobileapp () override

Public Static Functions

Type Name
void initDeclarative (QQmlEngine * engine)

Public Signals Documentation

signal loadProjectEnded

void QgisMobileapp::loadProjectEnded;

Emitted when the project is fully loaded


signal loadProjectTriggered

void QgisMobileapp::loadProjectTriggered;

Emitted when a project file is being loaded

Parameters:

  • filename The filename of the project that is being loaded
  • name The project name that is being loaded

signal setMapExtent

void QgisMobileapp::setMapExtent;

Emitted when a map canvas extent change is needed


Public Functions Documentation

function QgisMobileapp

explicit QgisMobileapp::QgisMobileapp (
    QgsApplication * app,
    QObject * parent=nullptr
) 

function clearProject

void QgisMobileapp::clearProject () 

Clear the currently opened project back to a blank project


function event

bool QgisMobileapp::event (
    QEvent * event
) override

function loadProjectFile

bool QgisMobileapp::loadProjectFile (
    const QString & path,
    const QString & name=QString()
) 

Set the project or dataset file path to be loaded.

Parameters:

  • path The project or dataset file to load
  • name The project name

Note:

The actual loading is done in readProjectFile


function print

bool QgisMobileapp::print (
    const QString & layoutName
) 

Prints a given layout from the currently opened project to a PDF file

Parameters:

  • layoutName the layout name that will be printed

Returns:

TRUE if the layout was successfully printed


function printAtlasFeatures

bool QgisMobileapp::printAtlasFeatures (
    const QString & layoutName,
    const QList< long long > & featureIds
) 

Prints a given atlas-driven layout from the currently opened project to one or more PDF files

Parameters:

  • layoutName the layout name that will be printed
  • featureIds the features from the atlas coverage vector layer that will be used to print the layout

Returns:

TRUE if the layout was successfully printed


function readProjectBoolEntry

bool QgisMobileapp::readProjectBoolEntry (
    const QString & scope,
    const QString & key,
    bool def=false
) const

Reads a boolean from the specified scope and key from the currently opened project

Parameters:

  • scope entry scope (group) name
  • key entry key name. Keys are '/'-delimited entries, implying a hierarchy of keys and corresponding values
  • def default value to return if the specified key does not exist within the scope

Returns:

entry value as boolean from scope given its key


function readProjectDoubleEntry

double QgisMobileapp::readProjectDoubleEntry (
    const QString & scope,
    const QString & key,
    double def=0.0
) const

Reads a double from the specified scope and key from the currently opened project

Parameters:

  • scope entry scope (group) name
  • key entry key name. Keys are '/'-delimited entries, implying a hierarchy of keys and corresponding values
  • def default value to return if the specified key does not exist within the scope

Returns:

entry value as double from scope given its key


function readProjectEntry

QString QgisMobileapp::readProjectEntry (
    const QString & scope,
    const QString & key,
    const QString & def=QString()
) const

Reads a string from the specified scope and key from the currently opened project

Parameters:

  • scope entry scope (group) name
  • key entry key name. Keys are '/'-delimited entries, implying a hierarchy of keys and corresponding values
  • def default value to return if the specified key does not exist within the scope

Returns:

entry value as string from scope given its key


function readProjectFile

void QgisMobileapp::readProjectFile () 

Reads and opens the project file set in the loadProjectFile function


function readProjectNumEntry

int QgisMobileapp::readProjectNumEntry (
    const QString & scope,
    const QString & key,
    int def=0
) const

Reads an integer from the specified scope and key from the currently opened project

Parameters:

  • scope entry scope (group) name
  • key entry key name. Keys are '/'-delimited entries, implying a hierarchy of keys and corresponding values
  • def default value to return if the specified key does not exist within the scope

Returns:

entry value as integer from scope given its key


function recentProjects

QList< QPair< QString, QString > > QgisMobileapp::recentProjects () 

Returns a list of recent projects.


function reloadProjectFile

void QgisMobileapp::reloadProjectFile () 

Reloads the current project

Note:

It does not reset the Auth Request Handler.

Note:

The actual loading is done in readProjectFile


function removeRecentProject

void QgisMobileapp::removeRecentProject (
    const QString & path
) 

Removes the project with a given path from the list of recent projects


function saveRecentProjects

void QgisMobileapp::saveRecentProjects (
    const QList< QPair< QString, QString > > & projects
) 

Saves a list of recent projects.


function setScreenDimmerTimeout

void QgisMobileapp::setScreenDimmerTimeout (
    int timeoutSeconds
) 

Sets the screen dimmer timeout in seconds

Note:

setting the timeout value to 0 will disable the screen dimmer


function ~QgisMobileapp

QgisMobileapp::~QgisMobileapp () override

Public Static Functions Documentation

function initDeclarative

static void QgisMobileapp::initDeclarative (
    QQmlEngine * engine
) 


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