Contents

Units

Units of measurement for sizes, spacing, margin, etc. More...

Properties

Methods

Detailed Description

Units provides facilities for measuring UI elements in a variety of units other than just pixels.

A global instance of Units is exposed as the units context property. Example usage:

import QtQuick 2.0
import Ubuntu.Components 0.1

Item {
    width: units.gu(2)
    height: units.gu(5)
}

See also Resolution Independence.

Property Documentation

gridUnit : real

The number of pixels 1 grid unit corresponds to.


Method Documentation

real Units::dp(real value)

Returns the number of pixels value density independent pixels correspond to.


real Units::gu(real value)

Returns the number of pixels value grid units correspond to.