I'm trying to create a custom QML object. I started simple, by making a qml file called rect.qml:
import QtQuick 2.2
Rectangle
{ }
In the same directory, I wanted to use my rect object in a seperate qml file, called window.qml:
import QtQuick 2.2
Item {
id: mainWindow
rect
{ }
}
Very high caliber stuff, I know. Anyway, when I try to run my application, I get the following error:
qrc:/qml/window.qml:3:13: Cannot assign to non-existent property "rect"
So I checked my QRC file, and it goes as such:
<RCC>
<qresource prefix="/qml">
<file>window.qml</file>
<file>rect.qml</file>
</qresource>
</RCC>
According to the documentation (http://doc.qt.io/qt-5/qtqml-documents-definetypes.html) this application isn't very useful as it's so bare bones, (simplified for my question,) but there shouldn't be an error.
Any help would be very appreciated!