[Kde-java] Qt Designer javaeditor plugin

Richard Dale Richard_Dale at tipitina.demon.co.uk
Thu Jun 19 10:28:40 CEST 2003


On Thursday 19 June 2003 08:02, Marco Ladermann wrote:
> Am Mittwoch, 18. Juni 2003 22:41 schrieb Richard Dale:
> > I've been hacking at the code in the Qt Designer cppeditor plugin to
> > create a Java version, it seems 'almost useful'. Here are my notes from
> > the README file:
>
> I was also thinking of extending the designer, but my time ...
> So I greatly welcome your efforts!
>
> > TO DO
> >
> > - The editor code completion popup shows C++ methods - is it possible to
> > show Java methods?
> > - More work needed on adding <some name>.ui.java instead of <some
> > name>.ui.h and doing suitable java code merging when generating the java
> > sources from the .ui files.
>
> My idea was to generate a <some name>.ui.xml file to make it accessible by
> the stylesheets. This would be much more consistent compared to the hybrid
> approach of the original Qt Designer .
I'm not sure java programmers would want to customise behaviour by writing 
java embedded in xml though - it sounds a bit ugly to me.

The idea of the .ui.h file was to allow C++ methods to be added to a class 
generated from a .ui file. If there were init() or destroy() methods added in 
the .ui.h, then calls to them are included in the constructor/destructor of 
the generated class.

So the equivalent in Java would be to have a <some name>.ui.java file 
containing additional java methods. When the java class was being generated 
from the .ui file, instead of a include directive for the .ui.h file, it 
would merge to java methods from the .ui.java into the generated class. I 
would have thought XSLT could do that ok - it doesn't sound complicated to 
me.

If a method called init() had been added to the .ui.java file then the 
constructor would call it. Java doesn't have destructors, so destroy() 
doesn't seem to fit in.

> I will have a look at your sources, at least to increase my C++ skills ;-)
Well not really my code (thankyou Trolltech!), I mostly just changed 'Cpp' to 
'Java' everywhere. 

A couple of the dialogs in the javaeditor are .ui files, so they can be 
changed quite easily to be more java-like if needed - we don't need 4 
different build systems for 4 platforms - maybe just generate a suitable ant 
build file for the project, or automake for gcj.

-- Richard


More information about the Kde-java mailing list