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

Qt-jambi-interest Archive, June 2007
generator problem


Message 1 in thread

Hi, I'm trying to create a simple binding with the generator, but when my C++ 
class inherits QWidget I receive a error from the generator:

$ generator allheaders.h typesystem.xml --output-directory=out
WARNING(MetaJavaBuilder) :: Class 'QByteArray' has equals operators but no 
qHash() function
CppImplGenerator::fromObject(): class 'QActionEvent' could not be resolved...


My typesystem.xml is only:
<typesystem package="qwtwrapper"
                        default-superclass="com.trolltech.qt.QtJambiObject">
        <load-typesystem name=":/trolltech/generator/typesystem_gui.txt" 
generate="no" />
        <load-typesystem name=":/trolltech/generator/typesystem_core.txt" 
generate="no" />

        <object-type name="Plot" />
        <interface-type name="Data" />
</typesystem>

and plot.h is:

#ifndef PLOT_H
#define PLOT_H
#include <QWidget>

class Data;

class Plot : public QWidget {
Q_OBJECT
public:
        Plot(QWidget* parent = 0);
        ~Plot();

        void setData(Data* data);
private:
        class PlotPrivate;
        PlotPrivate* d;
};

#endif

Why QActionEvent not found? because exists 
on :/trolltech/generator/typesystem_gui.txt.

-- 
 [ signature omitted ] 

Attachment: signature.asc
Description: This is a digitally signed message part.


Message 2 in thread

Hugo Parente Lima wrote:
> Hi, I'm trying to create a simple binding with the generator, but when my C++ 
> class inherits QWidget I receive a error from the generator:
> 
> $ generator allheaders.h typesystem.xml --output-directory=out
> WARNING(MetaJavaBuilder) :: Class 'QByteArray' has equals operators but no 
> qHash() function
> CppImplGenerator::fromObject(): class 'QActionEvent' could not be resolved...

Hi Hugo,

The Generator's parser requires you to actually include all classes, not 
only forward declare them. For the typesystem piece to work you need to 
include action event in the header file. When you're inheriting 
typesystem_core and _gui you might as well just do:

#include <QtCore>
#include <QtGui>

and get everything.

This wouldn't happen to be Qwt your working on is it? ;-)

-
Gunnar