Please have a look at the attached small QML application. I have two QML files, which uses a shared JavaScript file. The JavaScript file declares a global variable - well that is what I believed it was, but in reality, it is global to the QML file it is used from.
Try running it, and you will see that global.qml and Block.qml each seems to have their own local instance of the global variable. Now the question is, is this a feature or a bug? And if it is a feature, how do I get a true global variable? Actually, I already have a few solutions: 1) Make the variable a property on a QML object. That will, however, not work for complex data types like a map 2) Make the data live in C++ - will not work if I want a QML only project. Cheers Jesper. -- Jesper K. Pedersen | [email protected] Senior Software Engineer and Global Training Manager Klarälvdalens Datakonsult AB, a KDAB Group company Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322) KDAB - Qt Experts - Platform-independent software solutions
global.tgz
Description: application/compressed-tar
_______________________________________________ Qt-qml mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt-qml
