QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
Qgis Class Reference

The Qgis class provides global constants for use throughout the application. More...

#include <qgis.h>

Public Types

enum  DataType {
  UnknownDataType = 0 , Byte = 1 , UInt16 = 2 , Int16 = 3 ,
  UInt32 = 4 , Int32 = 5 , Float32 = 6 , Float64 = 7 ,
  CInt16 = 8 , CInt32 = 9 , CFloat32 = 10 , CFloat64 = 11 ,
  ARGB32 = 12 , ARGB32_Premultiplied = 13
}
 Raster data types. More...
 
enum  MessageLevel {
  Info = 0 , Warning = 1 , Critical = 2 , Success = 3 ,
  None = 4
}
 Level for messages This will be used both for message log and message bar in application. More...
 
enum  PythonMacroMode {
  Never = 0 , Ask = 1 , SessionOnly = 2 , Always = 3 ,
  NotForThisSession
}
 Authorisation to run Python Macros. More...
 

Static Public Member Functions

static QString defaultProjectScales ()
 A string with default project scales. More...
 
static QString devVersion ()
 The development version. More...
 
static QString releaseName ()
 Release name. More...
 
static QString version ()
 Version string. More...
 
static int versionInt ()
 Version number used for comparing versions using the "Check QGIS Version" function. More...
 

Static Public Attributes

static const double DEFAULT_HIGHLIGHT_BUFFER_MM = 0.5
 Default highlight buffer in mm. More...
 
static const QColor DEFAULT_HIGHLIGHT_COLOR = QColor( 255, 0, 0, 128 )
 Default highlight color. More...
 
static const double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM = 1.0
 Default highlight line/stroke minimum width in mm. More...
 
static const float DEFAULT_MAPTOPIXEL_THRESHOLD = 1.0f
 Default threshold between map coordinates and device coordinates for map2pixel simplification. More...
 
static const double DEFAULT_SEARCH_RADIUS_MM = 2.
 Identify search radius in mm. More...
 
static const double DEFAULT_SNAP_TOLERANCE = 12.0
 Default snapping distance tolerance. More...
 
static const QgsTolerance::UnitType DEFAULT_SNAP_UNITS = QgsTolerance::Pixels
 Default snapping distance units. More...
 
static const double DEFAULT_Z_COORDINATE = 0.0
 Default Z coordinate value for 2.5d geometry This value have to be assigned to the Z coordinate for the new 2.5d geometry vertex. More...
 
static const char * QGIS_DEV_VERSION = QGSVERSION
 The development version. More...
 
static const double SCALE_PRECISION = 0.9999999999
 Fudge factor used to compare two scales. More...
 
static const double UI_SCALE_FACTOR = 1
 UI scaling factor. More...
 

Detailed Description

The Qgis class provides global constants for use throughout the application.

Definition at line 45 of file qgis.h.

Member Enumeration Documentation

◆ DataType

Raster data types.

This is modified and extended copy of GDALDataType.

Enumerator
UnknownDataType 

Unknown or unspecified type.

Byte 

Eight bit unsigned integer (quint8)

UInt16 

Sixteen bit unsigned integer (quint16)

Int16 

Sixteen bit signed integer (qint16)

UInt32 

Thirty two bit unsigned integer (quint32)

Int32 

Thirty two bit signed integer (qint32)

Float32 

Thirty two bit floating point (float)

Float64 

Sixty four bit floating point (double)

CInt16 

Complex Int16.

CInt32 

Complex Int32.

CFloat32 

Complex Float32.

CFloat64 

Complex Float64.

ARGB32 

Color, alpha, red, green, blue, 4 bytes the same as QImage::Format_ARGB32.

ARGB32_Premultiplied 

Color, alpha, red, green, blue, 4 bytes the same as QImage::Format_ARGB32_Premultiplied.

Definition at line 101 of file qgis.h.

◆ MessageLevel

Level for messages This will be used both for message log and message bar in application.

Enumerator
Info 
Warning 
Critical 
Success 
None 

Definition at line 88 of file qgis.h.

◆ PythonMacroMode

Authorisation to run Python Macros.

Since
QGIS 3.10
Enumerator
Never 

Macros are never run.

Ask 

User is prompt before running.

SessionOnly 

Only during this session.

Always 

Macros are always run.

NotForThisSession 

Macros will not be run for this session.

Definition at line 124 of file qgis.h.

Member Function Documentation

◆ defaultProjectScales()

QString Qgis::defaultProjectScales ( )
static

A string with default project scales.

Since
QGIS 3.12

Definition at line 270 of file qgis.cpp.

◆ devVersion()

QString Qgis::devVersion ( )
static

The development version.

Since
QGIS 3.12

Definition at line 293 of file qgis.cpp.

◆ releaseName()

QString Qgis::releaseName ( )
static

Release name.

Since
QGIS 3.12

Definition at line 288 of file qgis.cpp.

◆ version()

QString Qgis::version ( )
static

Version string.

Since
QGIS 3.12

Definition at line 276 of file qgis.cpp.

◆ versionInt()

int Qgis::versionInt ( )
static

Version number used for comparing versions using the "Check QGIS Version" function.

Since
QGIS 3.12

Definition at line 281 of file qgis.cpp.

Member Data Documentation

◆ DEFAULT_HIGHLIGHT_BUFFER_MM

const double Qgis::DEFAULT_HIGHLIGHT_BUFFER_MM = 0.5
static

Default highlight buffer in mm.

Since
QGIS 2.3

Definition at line 155 of file qgis.h.

◆ DEFAULT_HIGHLIGHT_COLOR

const QColor Qgis::DEFAULT_HIGHLIGHT_COLOR = QColor( 255, 0, 0, 128 )
static

Default highlight color.

The transparency is expected to only be applied to polygon fill. Lines and outlines are rendered opaque.

Since
QGIS 2.3

Definition at line 149 of file qgis.h.

◆ DEFAULT_HIGHLIGHT_MIN_WIDTH_MM

const double Qgis::DEFAULT_HIGHLIGHT_MIN_WIDTH_MM = 1.0
static

Default highlight line/stroke minimum width in mm.

Since
QGIS 2.3

Definition at line 161 of file qgis.h.

◆ DEFAULT_MAPTOPIXEL_THRESHOLD

const float Qgis::DEFAULT_MAPTOPIXEL_THRESHOLD = 1.0f
static

Default threshold between map coordinates and device coordinates for map2pixel simplification.

Definition at line 141 of file qgis.h.

◆ DEFAULT_SEARCH_RADIUS_MM

const double Qgis::DEFAULT_SEARCH_RADIUS_MM = 2.
static

Identify search radius in mm.

Since
QGIS 2.3

Definition at line 138 of file qgis.h.

◆ DEFAULT_SNAP_TOLERANCE

const double Qgis::DEFAULT_SNAP_TOLERANCE = 12.0
static

Default snapping distance tolerance.

Since
QGIS 3.0

Definition at line 189 of file qgis.h.

◆ DEFAULT_SNAP_UNITS

const QgsTolerance::UnitType Qgis::DEFAULT_SNAP_UNITS = QgsTolerance::Pixels
static

Default snapping distance units.

Since
QGIS 3.0

Definition at line 195 of file qgis.h.

◆ DEFAULT_Z_COORDINATE

const double Qgis::DEFAULT_Z_COORDINATE = 0.0
static

Default Z coordinate value for 2.5d geometry This value have to be assigned to the Z coordinate for the new 2.5d geometry vertex.

Since
QGIS 3.0

Definition at line 176 of file qgis.h.

◆ QGIS_DEV_VERSION

const char * Qgis::QGIS_DEV_VERSION = QGSVERSION
static

The development version.

Definition at line 72 of file qgis.h.

◆ SCALE_PRECISION

const double Qgis::SCALE_PRECISION = 0.9999999999
static

Fudge factor used to compare two scales.

The code is often going from scale to scale denominator. So it looses precision and, when a limit is inclusive, can lead to errors. To avoid that, use this factor instead of using <= or >=.

Since
QGIS 2.15

Definition at line 169 of file qgis.h.

◆ UI_SCALE_FACTOR

const double Qgis::UI_SCALE_FACTOR = 1
static

UI scaling factor.

This should be applied to all widget sizes obtained from font metrics, to account for differences in the default font sizes across different platforms.

Since
QGIS 3.0

Definition at line 183 of file qgis.h.


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