Hartmann Thomas schreef op 28-4-2014 11:32:
> Hi,
>
> yes, writting C++ inline in QML would be another "tooling nightmare". Also 
> what is the problem with:
>
> MouseArea {
>      onClicked: companion.mouseAreaClicked();
> }
>
> If tooling creates the companion object for you (In a wizard) and code 
> completion and code naviagtion (F2) works as expected?
>

I'm not sure if I understand what you mean by a "companion" object. Why 
exactly do we need another object in the mix? Where does it come from? 
Where is exposed to the C++ side of things? What problem is it supposed 
to solve exactly?

QML already allows you to specify signals. Would exposing these signals 
on the C++ side through the object created by QQmlComponent::create not 
be enough? You could then on the QML side bind the handler to signal on 
the root object (directly or indirectly), and handle the signal on the 
C++ side. Tooling-wise, I _guess_ these signals could be exposed for 
code completion and the likes.

But... you can already do something like that. You can already expose a 
custom QObject with slots to QML that you can use to bind your handlers 
to. Sort of like a UI controller object.


André
_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to