how to use a class written in javascript to qml ?
-
"var"
-
wrote on 15 Dec 2013, 11:13 last edited by
on the type of var gives this error "
(qrc:/tank/tank1.qml:10:14: Expected property type)
QDeclarativeComponent: Component is not ready
QGraphicsScene::addItem: cannot add null item" -
"Component is not ready" suggests that it takes time for your component to load. You need to wait until it finishes loading, before assigning it to a variable.
Do the assignment inside the Component.onCompleted() signal handler. See:
-
wrote on 16 Dec 2013, 01:33 last edited by
The 'var' property type is only available in QtQuick 2.0, not in QtQuick 1.0. (Well, technically, in QtQml 2.0, but yeah.)
Cheers,
Chris. -
[quote author="chrisadams" date="1387157603"]The 'var' property type is only available in QtQuick 2.0, not in QtQuick 1.0. (Well, technically, in QtQml 2.0, but yeah.)[/quote]Ah, good catch.
september, are you able to upgrade to Qt Quick 2? Qt Quick 1 is obsolete now.
4/6