Trolltech Home | QSA-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

QSA-interest Archive, August 2005
dynamic method or property invocations


Message 1 in thread

Hello, QSA gurus:

Is it possible in QSA to somehow allow runtime calls to methods that are
only known at runtime? I read the documentation, and it seems that the
ojbects of classes that extend QObject become scriptable automatically, or
one could use the QSWrapperFactory class to wrap non-QObject classes and
make them scriptable this way. But in both cases all the methods are know at
compile time.

What if the methods are known only at runtime? Is there a way to tell the
scripting engine at runtime to translate method calls or property calls to
c++ method invocations? In other words, how can I tell the scripting engine
to translate the following script call:

object.method(p1);

to a c++ call:

cppojbect.invoke("method1", p1);

where object, let's say, is of a certain type. From what I read, QSA is
using the metadata information to make the calls. It might be a wild idea,
but would it be possible to generate the metadata information on the fly?

I am still trying to figure out if I can create and invoke ActiveX ojbects.
I posted a message a while ago but nobody answered.


Thanks



Message 2 in thread

B.C. wrote:
> What if the methods are known only at runtime? Is there a way to tell the
> scripting engine at runtime to translate method calls or property calls to
> c++ method invocations? In other words, how can I tell the scripting engine
> to translate the following script call:
> 
> object.method(p1);
> to a c++ call:
> cppojbect.invoke("method1", p1);

This will happen automatically in QSA. If object is a QObject, then the 
call to "method" will be bound at run time using the meta data in the 
object.

> where object, let's say, is of a certain type. From what I read, QSA is
> using the metadata information to make the calls. It might be a wild idea,
> but would it be possible to generate the metadata information on the fly?

This is possible. We are in fact using a dynamic meta object in QSA for 
connecting C++ signals to QSA functions.

> I am still trying to figure out if I can create and invoke ActiveX ojbects.
> I posted a message a while ago but nobody answered.

Volker replied here:
http://lists.trolltech.com/qsa-interest/2005-08/msg00010.html#msg00010

best regards,
Eskil


Message 3 in thread

> This is possible. We are in fact using a dynamic meta object in QSA for
> connecting C++ signals to QSA functions.
>

Could you please point me to the source code file that does this?

Thx

"Eskil A. Blomfeldt" <eblomfel@xxxxxxxxxxxxx> wrote in message
news:deh9m7$tgp$1@xxxxxxxxxxxxxxxxxxxxx
> B.C. wrote:
> > What if the methods are known only at runtime? Is there a way to tell
the
> > scripting engine at runtime to translate method calls or property calls
to
> > c++ method invocations? In other words, how can I tell the scripting
engine
> > to translate the following script call:
> >
> > object.method(p1);
> > to a c++ call:
> > cppojbect.invoke("method1", p1);
>
> This will happen automatically in QSA. If object is a QObject, then the
> call to "method" will be bound at run time using the meta data in the
> object.
>
> > where object, let's say, is of a certain type. From what I read, QSA is
> > using the metadata information to make the calls. It might be a wild
idea,
> > but would it be possible to generate the metadata information on the
fly?
>
> This is possible. We are in fact using a dynamic meta object in QSA for
> connecting C++ signals to QSA functions.
>
> > I am still trying to figure out if I can create and invoke ActiveX
ojbects.
> > I posted a message a while ago but nobody answered.
>
> Volker replied here:
> http://lists.trolltech.com/qsa-interest/2005-08/msg00010.html#msg00010
>
> best regards,
> Eskil