UI files | Qt Creator Documentation
Description: Limitations of Qt Design Studio UI files (.ui.qml).

- Qt Creator Documentation
- UI files
- Qt Creator 17.0.1

Reference

# UI files

If you switch between Qt Creator and Qt Design Studio or cooperate with designers on a project, you might encounter UI files (.ui.qml). They are intended to be edited in Qt Design Studio only.

To open UI files with Qt Design Studio, select Open With > Qt Design Studio in the context menu for the file.

The following features are not supported in .ui.qml files:

- JavaScript blocks
- Other bindings than pure expressions
- Signal handlers
- States in other components than the root component
- Root components that are not derived from QQuickItem or Item
- Referencing the parent of the root component

The following components are not supported:

- Behavior
- Binding
- Canvas
- Shader Effect
- Timer
- Transform

## Supported Methods

Qt Creator supports most JavaScript functions that are supported by the QML engine, as well as a subset of Qt QML methods.

This section lists the functions that you can use in .ui.qml files.

### JavaScript Functions

As a rule of thumb, pure functions are supported. They only depend on and modify states of parameters that are within their scope, and therefore always return the same results when given the same parameters. This makes it possible to convert and reformat property bindings without breaking the .ui.qml files.

The following JavaScript functions are supported:

- `charAt()`
- `charCodeAt()`
- `concat()`
- `endsWith()`
- `includes()`
- `indexOf()`
- `isFinite()`
- `isNaN()`
- `lastIndexOf()`
- `substring()`
- `toExponential()`
- `toFixed()`
- `toLocaleLowerCase()`
- `toLocaleString`
- `toLocaleUpperCase()`
- `toLowerCase()`
- `toPrecision()`
- `toString()`
- `toUpperCase()`
- `valueOf()`

In addition, all functions of the `Math` and `Date` objects are supported.

For more information, see List of JavaScript Objects and Functions.

### Qt QML Methods

Qt Creator supports color methods, helper methods for creating objects of specific data types, and translation methods.

The following color methods are supported:

- Qt.darker()
- Qt.hsla()
- Qt.hsva()
- Qt.lighter()
- Qt.rgba()
- Qt.tint()

The following helper methods are supported:

- Qt.formatDate()
- Qt.formatDateTime()
- Qt.formatTime()
- Qt.matrix4x4()
- Qt.point()
- Qt.quaternion()
- Qt.rect()
- Qt.size()
- Qt.vector2d()
- Qt.vector3d()
- Qt.vector4d()

The following translation methods are supported:

- qsTr()
- qsTranslate()
- QT_TRANSLATE_NOOP()
- qsTrId()
- QT_TRID_NOOP()
- QT_TR_NOOP()

Note: Do not mix translation methods in a UI file.

For more information about using the methods, see Qt QML Methods.

See also Qt Quick Designer.

Reference