On Mon, Feb 25, 2013 at 5:56 AM, Charley Bay <[email protected]> wrote: > I'm sure this is a silly question, but why are these different: > > // FILE: MyItem0.qml > import QtQuick 2.0 > import my.custom.cpp 1.0 //<==NOTE NO "as" > > Item { > property MyCppType myCppType // WORKS > } > > // FILE: MyItem1.qml > import QtQuick 2.0 > import my.custom.cpp 1.0 as MyCpp //<==NOTE "as" > > Item { > property MyCpp.MyCppType myCppType // NOT WORK > } > > QUESTION: If I import the C++ custom types with an "as MyCpp", then I can > no longer use the type as a "property" within QML. Dropping the "as-module" > name works. > > The compile error is at the "dot" separating the "MyCpp" from "MyCppType", > with an error: > >> property MyCpp.MyCppType myCppType >> ^ >> "Unexpected token '.'" > > > I assume package/namespace/plugin scoping names are not allowed for defining > properties in QML? Does this mean you can't use "as-namespaces" in a QML > file when you want that C++ type as a "property"?
I wouldn't so much say "not allowed" as not working. This looks like a bug to me, please file it at bugreports.qt-project.org . -- Alan Alpert _______________________________________________ Interest mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/interest
