[Development] Question about Qt's future

Hartmann Thomas Thomas.Hartmann at digia.com
Mon Apr 28 12:21:56 CEST 2014


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 [njeisecke at saltation.de]
Sent: 28 April 2014 11:56
To: Hartmann Thomas
Cc: development at qt-project.org
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



More information about the Development mailing list