C

QML types in Qt Quick Ultralite

The following topics define how QML types are supported in Qt Quick Ultralite. Qt Quick Ultralite does not support functions, object methods, and properties that are typically available in QML but are not mentioned in this topic.

QML basic types

Qt Quick Ultralite supports only a subset of the QML basic types. The following basic types are supported:

  • bool
  • double
  • enumeration
  • int
  • string
  • real

Known issues

real and double are both mapped to a float type in the generated C++ code.

Other basic types

In later Qt Quick Ultralite releases, the QML basic types are planned to be supported as follows:

A QML basic typeSupport status
varCurrently supported only in script expressions. Using var as a property type is planned to be supported in later Qt Quick Ultralite releases.
listNot supported
urlNot supported

Global QML object types

The Qt QML type is supported in Qt Quick Ultralite as follows:

The Qul object type is available only in the Qt Quick Ultralite implementation. For detailed information, see Qt Quick Ultralite C++ Classes.

The Qul object has the following methods:

  • Qul.image(argument)
  • Qul.color(argument)

The argument in Qul.image and Qul.color is something that can be converted to an image or a color at compile time.

These methods are wrappers that help the code generator to deduce types. For example, you can use them as follows:

source: Qul.image("images/setup.png")
color: Qul.color("#90989D")

QML object types

Component

The completed() signal is supported in Qt Quick Ultralite. Otherwise, the Component QML type is not supported.

QtObject

The QtObject QML type is a pure container that does not provide any methods or properties.

Timer

The whole Timer QML type API except triggeredOnStart() is supported.

Lists and models

Only static models are supported in Qt Quick Ultralite but you can define dynamic models in C++. In later Qt Quick Ultralite releases, dynamically changeable properties may also be provided.

Current limitations with referencing objects from other files:

  • You can define a visual delegate object inline but you cannot define it in an other file.
  • You cannot use ListModel as a model if the ListModel object is declared in some other file.

To access data from a model, you need to use the modelData prefix.

ListModel

The ListModel QML type is a readonly list of elements. Qt Quick Ultralite supports the following methods:

  • get(index)

Available under certain Qt licenses.
Find out more.