[Interest] modules QtQml.Models

Joey DiGiorgio digiorgiojoey at gmail.com
Wed Nov 6 22:23:07 CET 2019


Hi All,

I just wanted to ask if anyone is having problems importing
QtQml.Models in their QML files. I have the following code.

```
import QtQuick 2.1
import QtQuick.Controls 2.0
import QtQuick.Window 2.0
import QtQml.Models 2.3

Item
{
    DelegateModel
    {
    }
    Rectangle
    {
        anchors.fill: parent
        color: "#FF0000"
    }
}
```

At runtime I get "module 'QtQml.Models" is not installed".

I am using Qt v5.10.1 for iOS. My liker flags look something similar
to the following.

```
...
-L${Qt5_ROOT}/lib \
...
...
-L${Qt5_ROOT}/qml/QtQuick.2 \
-L${Qt5_ROOT}/qml/QtQml/Models.2 \
...
...
-lqtquick2plugin \
-lmodelsplugin \
...
...

```

I am also linked against all of the modules/components listed in
<qt-installation>/qml/QtQml/Models.2/libmodelsplugin.prl

Everything builds and compiles, but at runtime, the QML engine can't
seem to find the Models.2 module.

Any ideas what might be happening? Do I need to set some type of
import path or link in some additional modules?

- Joey D.


More information about the Interest mailing list