[Kde-java] QtJava rewritten as a SMOKE adaptor?

Gert-Jan van der Heiden g.j.vanderheiden at genimen.com
Tue Aug 12 11:22:08 CEST 2003


> > But that doesn't program nice:
> > QApplicationInterface application  = QApplication.getInstace();
> > instead of:
> > QApplication application = new Application();
>
> No it should look like the second way. Inside the QApplication constructor,
> it would look something like this:
>
> proxy = (QApplicationInterface) Proxy.newProxyInstance(
>  						QApplication.class.getClassLoader(),
>  						new Class[] { QApplicationInterface.class },
>  						new QtProxy() );
> newApplication(args);
>
> The InvocationHandler class 'QtProxy' would have a built in method called
> 'setQt', and an instance variable '_qt', which would take a long that was
> the address of a new QApplication instance returned by the C++ constructor
> in the smoke library. That would be done inside the newApplication() call
> above, and the 'proxy' would need to forward 'setQt' calls to the QtProxy
> instance.

Ok, I roughly understand. You'll need the address of the C++ object if you 
wan't to make a call to SMOKE it in invoke method of QtProxy. But how do you 
plan to intercept calls to QApplication, e.g. QApplication.exec() ?



More information about the Kde-java mailing list