PDA

View Full Version : very little problem



dreamer
3rd May 2008, 09:44
i create my own class to create xml file, without inherite from any class.

header:


#ifndef __XML_H__
#define __XML_H__

#include <QtGui>
#include <myscene.h>

class XmlGenerator{
Q_OBJECT

public:
XmlGenerator(QString*,myscene*);

private slots:
void createDOM();

private:
//QDomDocument *document;
QTextStream *stream;
int indent;
myscene *scene;

};

#endif // __XML_H__


source:


#include "xml.h"

XmlGenerator::XmlGenerator(QString *file,myscene *s){

}

void XmlGenerator::createDOM(){


}


After compiling i had:
"undefined reference to `vtable for XmlGenerator'".......What's wrong?
I also put #include<xml.h> in my main.cpp class

mitro
3rd May 2008, 09:47
You have to inherit your class from QObject in order to use signals and slots mechanism.

dreamer
3rd May 2008, 09:53
......the problem persist.........:(

dreamer
3rd May 2008, 09:58
.......:D:D.....deleting the compiled file and rigenerating it, it works well...