Units QML Type

Provides access to screen-independent Units known as DPs (device-independent pixels). More...

Import Statement: import quey.ui 0.1

Properties

Methods

Detailed Description

This singleton provides methods for building a user interface that automatically scales based on the screen density. Use the Units::dp function wherever you need to specify a screen size, and your app will automatically scale to any screen density.

Here is a short example:

import QtQuick 2.4
import quey.ui 0.1

Rectangle {
    width: Units.dp(100)
    height: Units.dp(80)

    Label {
        text:"A"
        font.pixelSize: Units.dp(50)
    }
}

Property Documentation

gridUnit : int


multiplier : real


Method Documentation

dp(number)

This is the standard function to use for accessing device-independent pixels. You should use this anywhere you need to refer to distances on the screen.


gu(number)