QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
Encapsulating the common utilities for QgsQuick library. More...
#include <qgsquickutils.h>
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... | |
Encapsulating the common utilities for QgsQuick library.
Definition at line 52 of file qgsquickutils.h.
QgsQuickUtils::QgsQuickUtils | ( | QObject * | parent = nullptr | ) |
Create new utilities.
Definition at line 24 of file qgsquickutils.cpp.
|
default |
Destructor.
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.
|
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.