Units


Provides access to screen-independent Units known as DPs (device-independent pixels). More...
import Material 0.2
Properties and Methods

Detailed Description

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

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 Material 0.2

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

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

Properties

gridUnit : int
No description provided.
multiplier : real
No description provided.

Methods

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)
No description provided.