I don't know the specific use case why you want to return the QML element to C++ side - but _usually_ it's better to interact with QML from C++ with signals or property binding. I am pretty certain you can do whatever you need to do with these utilities as well. It's just bad design to interact directly with QML elements in C++.
-- Johan On Sat, Aug 6, 2011 at 1:32 PM, Tarantism <[email protected]> wrote: > On Fri, 2011-08-05 at 21:44 -0500, Jeremy wrote: >> So we give qml elements an 'id' name from within qml, but this name >> appears not to become the objects 'objectName', and as a result, one >> cannot seem to do recursive lookups for the objects by name using the >> QObject->child methods and such. Is there an alternative? > > I set the objectName property in qml for elements that need to be looked > up from C++. > > Item { > id: lookupable > objectName: "lookupable" > } > > Clumsy but effective. I'd be interested to know of a better approach. > > > _______________________________________________ > Qt-qml mailing list > [email protected] > http://lists.qt.nokia.com/mailman/listinfo/qt-qml > _______________________________________________ Qt-qml mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt-qml
