QGIS API Documentation  2.17.0-Master (bf77d09)
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  GeometryType {
  Point, Line, Polygon, UnknownGeometry,
  NoGeometry
}
 
enum  UnitType {
  Meters = 0, Feet = 1, Degrees = 2, NauticalMiles = 7,
  Kilometers = 8, Yards = 9, Miles = 10, UnknownUnit = 3,
  DecimalDegrees = 2, DegreesMinutesSeconds = 2, DegreesDecimalMinutes = 2
}
 Map units that qgis supports. More...
 
enum  UserEvent { ProviderExtentCalcEvent = ( QEvent::User + 1 ), ProviderCountCalcEvent }
 User defined event types. More...
 
enum  WkbType {
  WKBUnknown = 0, WKBPoint = 1, WKBLineString, WKBPolygon,
  WKBMultiPoint, WKBMultiLineString, WKBMultiPolygon, WKBNoGeometry = 100,
  WKBPoint25D = 0x80000001, WKBLineString25D, WKBPolygon25D, WKBMultiPoint25D,
  WKBMultiLineString25D, WKBMultiPolygon25D
}
 Used for symbology operations. More...
 

Static Public Member Functions

static const char * featureType (WkbType type)
 description strings for feature types More...
 
static WkbType flatType (WkbType type)
 Map 2d+ to 2d type. More...
 
static Q_DECL_DEPRECATED UnitType fromLiteral (const QString &literal, QGis::UnitType defaultType=UnknownUnit)
 Converts from the canonical name to the type value. More...
 
static QGis::WkbType fromNewWkbType (QgsWKBTypes::Type type)
 Converts from new (post 2.10) WKB type (OGC) to old WKB type. More...
 
static QgsWKBTypes::Type fromOldWkbType (QGis::WkbType type)
 Converts from old (pre 2.10) WKB type (OGR) to new WKB type. More...
 
static Q_DECL_DEPRECATED UnitType fromTr (const QString &literal, QGis::UnitType defaultType=UnknownUnit)
 Provides type value from translated version. More...
 
static Q_DECL_DEPRECATED double fromUnitToUnitFactor (QGis::UnitType fromUnit, QGis::UnitType toUnit)
 Returns the conversion factor between the specified units. More...
 
static bool isMultiType (WkbType type)
 Return if type is a multi type. More...
 
static bool isSingleType (WkbType type)
 Return if type is a single type. More...
 
static WkbType multiType (WkbType type)
 Map single to multitype type. More...
 
static double permissiveToDouble (QString string, bool &ok)
 Converts a string to a double in a permissive way, eg allowing for incorrect numbers of digits between thousand separators. More...
 
static int permissiveToInt (QString string, bool &ok)
 Converts a string to an integer in a permissive way, eg allowing for incorrect numbers of digits between thousand separators. More...
 
static WkbType singleType (WkbType type)
 Map multi to single type. More...
 
static Q_DECL_DEPRECATED QString toLiteral (QGis::UnitType unit)
 Provides the canonical name of the type value. More...
 
static Q_DECL_DEPRECATED QString tr (QGis::UnitType unit)
 Provides translated version of the type value. More...
 
static const char * vectorGeometryType (GeometryType type)
 description strings for geometry types More...
 
static int wkbDimensions (WkbType type)
 

Static Public Attributes

static 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 double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM = 1.0
 Default highlight line/outline minimum width in mm. More...
 
static Q_DECL_DEPRECATED const double DEFAULT_IDENTIFY_RADIUS = 0.5
 Old search radius in % of canvas width. 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 char * QGIS_DEV_VERSION = QGSVERSION
 
static QString QGIS_RELEASE_NAME
 
static QString QGIS_VERSION
 
static const int QGIS_VERSION_INT = VERSION_INT
 
static double SCALE_PRECISION = 0.9999999999
 Fudge factor used to compare two scales. More...
 

Detailed Description

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

Definition at line 40 of file qgis.h.

Member Enumeration Documentation

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 133 of file qgis.h.

Enumerator
Point 
Line 
Polygon 
UnknownGeometry 
NoGeometry 

Definition at line 115 of file qgis.h.

Map units that qgis supports.

Note
that QGIS < 1.4 api had only Meters, Feet, Degrees and UnknownUnit
and QGIS >1.8 returns to that
Enumerator
Meters 

meters

Feet 

imperial feet

Degrees 

degrees, for planar geographic CRS distance measurements

NauticalMiles 

nautical miles

Kilometers 

kilometers

Yards 

imperial yards

Miles 

terrestial miles

UnknownUnit 

unknown distance unit

DecimalDegrees 
DegreesMinutesSeconds 
DegreesDecimalMinutes 

Definition at line 159 of file qgis.h.

User defined event types.

Enumerator
ProviderExtentCalcEvent 

The extents have been calculated by a provider of a layer.

ProviderCountCalcEvent 

The row count has been calculated by a provider of a layer.

Definition at line 218 of file qgis.h.

Used for symbology operations.

Enumerator
WKBUnknown 
WKBPoint 
WKBLineString 
WKBPolygon 
WKBMultiPoint 
WKBMultiLineString 
WKBMultiPolygon 
WKBNoGeometry 
WKBPoint25D 
WKBLineString25D 
WKBPolygon25D 
WKBMultiPoint25D 
WKBMultiLineString25D 
WKBMultiPolygon25D 

Definition at line 61 of file qgis.h.

Member Function Documentation

const char * QGis::featureType ( QGis::WkbType  type)
static

description strings for feature types

Definition at line 461 of file qgis.cpp.

QGis::WkbType QGis::flatType ( QGis::WkbType  type)
static

Map 2d+ to 2d type.

Definition at line 401 of file qgis.cpp.

QGis::UnitType QGis::fromLiteral ( const QString literal,
QGis::UnitType  defaultType = UnknownUnit 
)
static

Converts from the canonical name to the type value.

Deprecated:
use QgsUnitTypes::decodeDistanceUnit() instead

Definition at line 191 of file qgis.cpp.

QGis::WkbType QGis::fromNewWkbType ( QgsWKBTypes::Type  type)
static

Converts from new (post 2.10) WKB type (OGC) to old WKB type.

Definition at line 146 of file qgis.cpp.

QgsWKBTypes::Type QGis::fromOldWkbType ( QGis::WkbType  type)
static

Converts from old (pre 2.10) WKB type (OGR) to new WKB type.

Definition at line 106 of file qgis.cpp.

QGis::UnitType QGis::fromTr ( const QString literal,
QGis::UnitType  defaultType = UnknownUnit 
)
static

Provides type value from translated version.

Deprecated:
use QgsUnitTypes::stringToDistanceUnit() instead

Definition at line 208 of file qgis.cpp.

double QGis::fromUnitToUnitFactor ( QGis::UnitType  fromUnit,
QGis::UnitType  toUnit 
)
static

Returns the conversion factor between the specified units.

Deprecated:
use QgsUnitTyoes::fromUnitToUnitFactor() instead

Definition at line 215 of file qgis.cpp.

bool QGis::isMultiType ( QGis::WkbType  type)
static

Return if type is a multi type.

Definition at line 427 of file qgis.cpp.

bool QGis::isSingleType ( QGis::WkbType  type)
static

Return if type is a single type.

Definition at line 422 of file qgis.cpp.

QGis::WkbType QGis::multiType ( QGis::WkbType  type)
static

Map single to multitype type.

Definition at line 380 of file qgis.cpp.

double QGis::permissiveToDouble ( QString  string,
bool &  ok 
)
static

Converts a string to a double in a permissive way, eg allowing for incorrect numbers of digits between thousand separators.

Parameters
stringstring to convert
okwill be set to true if conversion was successful
Returns
string converted to double if possible
Note
added in version 2.9
See also
permissiveToInt

Definition at line 220 of file qgis.cpp.

int QGis::permissiveToInt ( QString  string,
bool &  ok 
)
static

Converts a string to an integer in a permissive way, eg allowing for incorrect numbers of digits between thousand separators.

Parameters
stringstring to convert
okwill be set to true if conversion was successful
Returns
string converted to int if possible
Note
added in version 2.9
See also
permissiveToDouble

Definition at line 227 of file qgis.cpp.

QGis::WkbType QGis::singleType ( QGis::WkbType  type)
static

Map multi to single type.

Definition at line 359 of file qgis.cpp.

QString QGis::toLiteral ( QGis::UnitType  unit)
static

Provides the canonical name of the type value.

Deprecated:
use QgsUnitTypes::encodeUnit() instead

Definition at line 198 of file qgis.cpp.

QString QGis::tr ( QGis::UnitType  unit)
static

Provides translated version of the type value.

Deprecated:
use QgsUnitTypes::toString() instead

Definition at line 203 of file qgis.cpp.

const char * QGis::vectorGeometryType ( QGis::GeometryType  type)
static

description strings for geometry types

Definition at line 441 of file qgis.cpp.

int QGis::wkbDimensions ( QGis::WkbType  type)
static

Definition at line 432 of file qgis.cpp.

Member Data Documentation

double QGis::DEFAULT_HIGHLIGHT_BUFFER_MM = 0.5
static

Default highlight buffer in mm.

Note
added in 2.3

Definition at line 247 of file qgis.h.

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.

Note
added in 2.3

Definition at line 243 of file qgis.h.

double QGis::DEFAULT_HIGHLIGHT_MIN_WIDTH_MM = 1.0
static

Default highlight line/outline minimum width in mm.

Note
added in 2.3

Definition at line 251 of file qgis.h.

const double QGis::DEFAULT_IDENTIFY_RADIUS = 0.5
static

Old search radius in % of canvas width.

Deprecated:
since 2.3, use DEFAULT_SEARCH_RADIUS_MM

Definition at line 231 of file qgis.h.

const float QGis::DEFAULT_MAPTOPIXEL_THRESHOLD = 1.0f
static

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

Definition at line 238 of file qgis.h.

const double QGis::DEFAULT_SEARCH_RADIUS_MM = 2.
static

Identify search radius in mm.

Note
added in 2.3

Definition at line 235 of file qgis.h.

const char * QGis::QGIS_DEV_VERSION = QGSVERSION
static

Definition at line 52 of file qgis.h.

QString QGis::QGIS_RELEASE_NAME
static

Definition at line 50 of file qgis.h.

QString QGis::QGIS_VERSION
static

Definition at line 46 of file qgis.h.

const int QGis::QGIS_VERSION_INT = VERSION_INT
static

Definition at line 48 of file qgis.h.

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 >=.

Note
added in 2.15

Definition at line 257 of file qgis.h.


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