QGIS API Documentation  3.20.0-Odense (decaadbb31)
Public Member Functions | Properties | List of all members
QgsQuickUtils Class Reference

Encapsulating the common utilities for QgsQuick library. More...

#include <qgsquickutils.h>

Inheritance diagram for QgsQuickUtils:
Inheritance graph
[legend]

Public Member Functions

 QgsQuickUtils (QObject *parent=nullptr)
 Create new utilities. More...
 
 ~QgsQuickUtils ()=default
 Destructor. More...
 
qreal screenDensity () const
 "dp" is useful for building building components that work well with different screen densities. More...
 

Properties

qreal dp
 "dp" is useful for building building components that work well with different screen densities. More...
 

Detailed Description

Encapsulating the common utilities for QgsQuick library.

Note
QML Type: Utils (Singleton)
Since
QGIS 3.2

Definition at line 52 of file qgsquickutils.h.

Constructor & Destructor Documentation

◆ QgsQuickUtils()

QgsQuickUtils::QgsQuickUtils ( QObject *  parent = nullptr)

Create new utilities.

Definition at line 24 of file qgsquickutils.cpp.

◆ ~QgsQuickUtils()

QgsQuickUtils::~QgsQuickUtils ( )
default

Destructor.

Member Function Documentation

◆ screenDensity()

qreal QgsQuickUtils::screenDensity ( ) const

"dp" is useful for building building components that work well with different screen densities.

It stands for density-independent pixels. A width of 10dp is going to be the same physical size on all screens regardless their density. In QML code, all values are specified in screen pixels, so in order to set a width of 10dp, one would use the following code: "width: 10 * QgsQuick.Utils.dp"

1dp is approximately 0.16mm. When screen has 160 DPI (baseline), the value of "dp" is 1. On high DPI screen the value will be greater, e.g. 1.5.

This is a readonly property.

Definition at line 30 of file qgsquickutils.cpp.

Property Documentation

◆ dp

qreal QgsQuickUtils::dp
read

"dp" is useful for building building components that work well with different screen densities.

It stands for density-independent pixels. A width of 10dp is going to be the same physical size on all screens regardless their density. In QML code, all values are specified in screen pixels, so in order to set a width of 10dp, one would use the following code: "width: 10 * QgsQuick.Utils.dp"

1dp is approximately 0.16mm. When screen has 160 DPI (baseline), the value of "dp" is 1. On high DPI screen the value will be greater, e.g. 1.5.

This is a readonly property.

Definition at line 1 of file qgsquickutils.h.


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