[solved] error: undefined reference to `vtable for Biglietto’



  • @
    #ifndef BIGLIETTO_H
    #define BIGLIETTO_H

    #include <QColor>
    #include <QFile>
    #include <QTextStream>
    #include <QObject>

    class Biglietto : public QObject
    {
    Q_OBJECT

    public:
    explicit Biglietto(QString importanzaDellaParola, QString parolaDaTradurre, QString esempioTedesco, QString traduzioneDellaParola, QString esempioItaliano, QString sfondoDelBiglietto, QObject *parent = 0);

        Q_PROPERTY (QString sfondoBiglietto)
        Q_PROPERTY (QString parola)
        Q_PROPERTY (QString fraseInTedesco)
        Q_PROPERTY (QString traduzione)
        Q_PROPERTY (QString fraseInItaliano)
        Q_PROPERTY (QString importante)
    

    private:
    QString sfondoBiglietto;
    QString parola;
    QString fraseInTedesco;
    QString traduzione;
    QString fraseInItaliano;
    QString importante;
    };

    #endif // BIGLIETTO_H
    @

    @
    #include "biglietto.h"
    #include "gestore.h"

    Biglietto::Biglietto( QString importanzaDellaParola, QString parolaDaTradurre, QString esempioTedesco, QString traduzioneDellaParola, QString esempioItaliano, QString sfondoDelBiglietto, QObject *parent)
    : importante(importanzaDellaParola), parola(parolaDaTradurre), fraseInTedesco(esempioTedesco), traduzione(traduzioneDellaParola), fraseInItaliano(esempioItaliano), sfondoBiglietto(sfondoDelBiglietto), QObject(parent)
    {
    }
    @

    the problem is in the title of the topic and it is a reference to the last snippet, but i can not understand why...



  • Do you have HEADERS += biglietto.h in *.pro file? Did you run qmake?



  • From the "IRC factoids":http://tinyurl.com/qt-factoids

    Make sure the Q_OBJECT macro is present in the definition of all QObject-derived classes.

    Make sure you declare your QObject-derived classes in your header files ONLY.

    Make sure all of your header files are listed in your .pro file in the HEADERS= list.

    Run qmake every time you add Q_OBJECT to one of your classes or modify your .pro file.

    Also, check out http://doc.qt.nokia.com/latest/debug.html#common-bugs



  • yes, i did everything... now this error is solved. thank you! =)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.