Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Problem Using Directory Import for QML Files

$
0
0
I searched the forums and doc, and can’t figure this one out… I’m using Qt Creator 3.1.81 based on Qt 5.2.2 (Mac) with QtQuick 2.1 I’m trying to use a user-defined object type: import “../WeightPlateQtQ” (aside: the qml file I’m attempting to import is in the same directory and my main.qml, and yet I have to supply the above import statement. I couldn’t just say import “.”) My directory structure looks like this: + main.cpp | + WPResources.qrc | +-qml     |     + WeightPlateQtQ                    |                    + main.qml                    |                    + choosePlates.qml WPResources.qrc has this in it: <RCC>     <qresource prefix="/">         <file>qml/WeightPlateQtQ/main.qml</file>         <file>qml/WeightPlateQtQ/choosePlates.qml</file>     </qresource> </RCC> main.qml has this import statement (which seems to be OK since it gives no error); import "../WeightPlateQtQ" But when I try to use the type choosePlates like this, in main.qml: choosePlates {         id: platechooser         x: 15         y: 150         text: qsTr("Magic")         width: 200         height: 200     } I get the error: qrc:/qml/WeightPlateQtQ/main.qml:88:5: Cannot assign to non-existent property "choosePlates" choosePlates.qml just looks like this right now: import QtQuick 2.1 import QtQuick.Controls 1.0   Rectangle {     width: 1     height: 1     color: "purple" } This looks like it should be really really simple, so I figure I’m just doing something really really naive (or maybe stupid, you never know.) Can anyone provide enlightenment? Thanks! -Eric

Viewing all articles
Browse latest Browse all 4972

Latest Images

Trending Articles



Latest Images