expected constructor, destructor, or type conversion before ';' token (Q_DECLARE_METATYPE_CONTACT)

Viewed 2195

so i have defined the class with Qt creator (C++11) :

#ifndef CONTACT_H
#define CONTACT_H

#include <QStringList>
#include <list>

class Contact
{
public :
    Contact();
    ~Contact(); // destructeur

    Contact(const Contact & contact); // constructeur de copie
    Contact&  operator=(const  Contact& c); //opérateur de copie

    Contact( Contact && c); // constructeur de déplacement
    Contact&  operator=(Contact&& c); // opérateur de déplacement

    QString obtAdresse() const;
    void changeAdresse(QString adresse);

    QString obtFacebook() const;
    void changeFacebook(QString facebook);


    QString obtTwitter() const;
    void changeTwitter(QString twitter);

    QString obtNote() const;
    void changeNote(QString note);

    virtual  QString getnom() = 0;

    void reinitialise();

protected :
    QString adresse;
    QString facebook;
    QString twitter;
    QString note;

};

Q_DECLARE_METATYPE(Contact);

#endif // CONTACT_H

But i get this error : expected constructor, destructor, or type conversion before ';' token Q_DECLARE_METATYPE(Contact);

Thanks for your help and advice.

2 Answers
Related