Hi,

good point and this shows why it is actually no that easy to come up with a 
nice solution.

The most natural solution for me would be to just add the mouse property to the 
java script context
of the function call. The java script context would be a C++ argument.

slot: 
mouseAreaClicked(QJSContext context)
{
   context.get("mouse.x") ....
}

But currently this is not more then a couple of wild ideas.

Kind Regards,
Thomas Hartmann
________________________________________
From: Nils Jeisecke [[email protected]]
Sent: 28 April 2014 11:56
To: Hartmann Thomas
Cc: [email protected]
Subject: Re: [Development] Question about Qt's future

> Also what is the problem with:
>
> MouseArea {
>     onClicked: companion.mouseAreaClicked();
> }

Where is the event handler's argument (the one that's kind of
invisible in QML and requires you to read the documentation, I think
it's called "mouse" :-).

Could this be a function binding instead?

MouseArea {
     onClicked: companion.mouseAreaClicked;
}

Nils
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to