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

Qt-jambi-interest Archive, December 2006
Generator questions


Message 1 in thread

Basically I have a few questions

1.  Is it posible to run the generator once over multiple classes. For example, I've got
a library I've been using in qt in my project.  This library originally builds to a .dll
file and contains multiple classes, each in a Src/Include pair.  I want to build them
into QTJambi now.  So do I have to run the generator over each of the classes
individually and just specify them as part of the same basic package?  Or can I do it
all in one shot?  If so, is this done through the type system.

2.  I have generated the classes individually, however I keep getting the warning about
a class, the warning is of the form:
WARNING(MetaJavaBuilder) :: class 'subClass' inherits from unknown base class
'AFTMessageBase'
WARNING(MetaJavaBuilder) :: Unknown interface for 'subClass': 'baseClassInterface'

this base class is the base for multiple different sub classes so the error repeats in a
few places

also a similar warning happens if a method is passed another class.

Can I fix these warnings through the type system? or should I not worry about them for now?



Thanks,
Doug

--
 [ signature omitted ] 

Message 2 in thread

Douglas Orttenburger wrote:
> Basically I have a few questions
> 
> 1.  Is it posible to run the generator once over multiple classes. For example, I've got
> a library I've been using in qt in my project.  This library originally builds to a .dll
> file and contains multiple classes, each in a Src/Include pair.  I want to build them
> into QTJambi now.  So do I have to run the generator over each of the classes
> individually and just specify them as part of the same basic package?  Or can I do it
> all in one shot?  If so, is this done through the type system.

You have an arbitrary number of types in your typesystem specification.

an exerp from the typesystem to build QtGui:

   <value-type name="QTextTableFormat"/>
   <value-type name="QTextImageFormat"/>
   <value-type name="QTextFrameFormat"/>
   <value-type name="QTextLength"/>

...

   <object-type name="QAbstractItemView"/>
   <object-type name="QAbstractPageSetupDialog"/>
   <object-type name="QAbstractPrintDialog"/>
   <object-type name="QAbstractSlider"/>

...

   <enum-type name="QAbstractItemDelegate::EndEditHint"/>
   <enum-type name="QAbstractItemView::CursorAction"/>
   <enum-type name="QAbstractItemView::DragDropMode"/>

...

and so forth...


> 2.  I have generated the classes individually, however I keep getting the warning about
> a class, the warning is of the form:
> WARNING(MetaJavaBuilder) :: class 'subClass' inherits from unknown base class
> 'AFTMessageBase'
> WARNING(MetaJavaBuilder) :: Unknown interface for 'subClass': 'baseClassInterface'
> 
> this base class is the base for multiple different sub classes so the error repeats in a
> few places
> 
> also a similar warning happens if a method is passed another class.
> 
> Can I fix these warnings through the type system? or should I not worry about them for now?

Such warnings are pretty bad, as the generator will ignore the 
constructs representing these classes. The base class functions won't be 
present and the functions taking this class will be rejected by the 
generator as it doesn't know how to treat them.

You fix this by declaring all of your types in the typesystem, like you 
suggested above.


If you on the other hand explicitly want multiple libraries with 
dependencies you can include one typesystem in another to make the 
generator aware of these classes. This is in the generator_example like 
this:

   <load-typesystem name=":/trolltech/generator/typesystem_core.txt" 
generate="no" />
   <load-typesystem name=":/trolltech/generator/typesystem_gui.txt" 
generate="no" />

You load a typesystem, but don't generate for it. Add your own 
typesystem and you're good.

best regards,
Gunnar


Message 3 in thread

On Tue, 12 Dec 2006 10:02:40 +0100, Gunnar Sletta wrote
> Douglas Orttenburger wrote:
> > Basically I have a few questions
> > 
> > 1.  Is it posible to run the generator once over multiple classes. For example, I've got
> > a library I've been using in qt in my project.  This library originally builds to a .dll
> > file and contains multiple classes, each in a Src/Include pair.  I want to build them
> > into QTJambi now.  So do I have to run the generator over each of the classes
> > individually and just specify them as part of the same basic package?  Or can I do it
> > all in one shot?  If so, is this done through the type system.
> 
> You have an arbitrary number of types in your typesystem specification.
> 
> an exerp from the typesystem to build QtGui:
> 
>    <value-type name="QTextTableFormat"/>
>    <value-type name="QTextImageFormat"/>
>    <value-type name="QTextFrameFormat"/>
>    <value-type name="QTextLength"/>
> 
> ...
> 
>    <object-type name="QAbstractItemView"/>
>    <object-type name="QAbstractPageSetupDialog"/>
>    <object-type name="QAbstractPrintDialog"/>
>    <object-type name="QAbstractSlider"/>
> 
> ...
> 
>    <enum-type name="QAbstractItemDelegate::EndEditHint"/>
>    <enum-type name="QAbstractItemView::CursorAction"/>
>    <enum-type name="QAbstractItemView::DragDropMode"/>
> 
> ...
> 
> and so forth...

I hope I'm not abusing this, it's just that I can find so few examples to work with the
generator.  In regards to the above answer, If I declare all classes that I will use in
the type system, what should I pass in as a header file argument to the generator? 
Should I make a new header file that simply includes all the other header files that I
want to use, or something else entirely?


Thanks the help so far,
Doug


Message 4 in thread

Douglas Orttenburger wrote:

> I hope I'm not abusing this, it's just that I can find so few examples to work with the
> generator.  In regards to the above answer, If I declare all classes that I will use in
> the type system, what should I pass in as a header file argument to the generator? 
> Should I make a new header file that simply includes all the other header files that I
> want to use, or something else entirely?

Hi Douglas,

Yes, you should use a "master" header file that includes all the classes 
that you would like to include.

As for examples, we do intend to provide a tutorial on how to use the 
generator in a future release. We are aware of that the currently 
example set is minimal ;-)

best regards,
Gunnar