Qt Quick Ultralite is a subset of Qt Quick, therefore Qt Quick Ultralite source code by definition is compatible with Qt Quick. This topic lists all known exceptions and how to keep the code compatible with Qt Quick.
To reuse Qt Quick Ultralite code with QML objects that are not supported by QtQuick ,譬如 StaticText or ColorizedImage ,见 重用 Qt Quick Ultralite QML 对象采用 Qt QML .
Unlike Qt Quick, which requires a version number against the import statement, Qt Quick Ultralite ignores version number in the import statement. It always imports the latest version of the module. To write qml that is compatible with Qt Quick, the version number must not be omitted. To ensure your code will be syntax-compatible with Qt Quick use least Qt 5.15.
Using an enum as the property type is not supported in Qt Quick. To write compatible code, use the
int
type instead.
The following example is not compatible with Qt Quick:
enum Menu { MediaPlayerMenu, NavigationMenu, PhoneMenu, CarStatusMenu, MenuCount } property NormalModeModel.Menu menu: NormalModeModel.MediaPlayerMenu
To make it portable, you must replace the last line with the following one:
property int menu: NormalModeModel.MediaPlayerMenu
ListModel<T>
QML 类型
While the ListModel<T> property type can be used to specify model structure without providing the model data, it is not supported in Qt Quick.
To make the code compatible with Qt Quick, replace the
ListModel<T>
type with
var
.