QObject::QObject(const QObject&)' is private within this context
Bonjour,
Je fais appel à vous aujourd'hui car ça fait plusieurs jours que je bloque sur un problème et pas moyen de m'en dépêtrer. J'ai créé une classe film, jusque là rien d'anormal. J'ai voulu qu'elle puisse réagir lorsqu'un signal est lancé. Je l'ai donc fait hériter de la classe QObject. Et là c'est le drame, depuis je reçoit l'erreur:
Code:
1 2 3 4
| C:\Qt\5.3\mingw482_32\include\QtCore\qobject.h:465: erreur : 'QObject::QObject(const QObject&)' is private
Q_DISABLE_COPY(QObject)
H:\Filmothèque Qt\MyMediaLibraries\MyMediaLibraries\cpp.films\Movie.h:10: erreur : within this context
class Movie: public QObject |
Pourtant à aucun moment je copie un objet de ma classe donc je n'arrive pas à comprendre mon message d'erreur...
Voila mon code:
Movie.h
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| #include "cpp.infos/TheMovieDB.h"
class Movie: public QObject
{
Q_OBJECT
public:
Movie(QObject* parent=0);
void getInfos();
TheMovieDB *tmdb;
int id;
QString title;
QDate releaseDate;
QString genre;
int note;
bool alreadySeen;
bool favourite;
bool toBeSeen;
QString synopsis;
int duration;
QString path;
QString md5;
QString backdropPath;
QString backdropMD5;
QString posterPath;
QString posterMD5;
QString collection;
public slots:
void updateDatas();
}; |
Movie.cpp
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| #include "Movie.h"
#include "cpp.infos/TheMovieDB.h"
#include "generalfunctions.h"
Movie::Movie(QObject *parent):QObject(parent)
{
title = "";
md5 = "";
id = 0;
path = "";
releaseDate = QDate();
genre = "";
note = 0;
alreadySeen = false;
favourite = false;
toBeSeen = false;
synopsis = "";
duration = 0;
backdropPath = "";
backdropMD5 = "";
posterPath = "";
posterMD5 = "";
collection = "";
}
void Movie::getInfos()
{
QObject::connect( tmdb , SIGNAL( dataRetrieved() ) , this , SLOT( updateDatas() ));
tmdb->search(title);
}
void Movie::updateDatas()
{
title = tmdb->t_infosList["title"].toString();
md5 = "";
id = tmdb->t_infosList["id"].toInt();
path = "";
releaseDate = tmdb->t_infosList["release_date"].toDate();
note = tmdb->t_infosList["note"].toInt();
synopsis = tmdb->t_infosList["overview"].toString();
backdropPath = tmdb->t_infosList["backdrop"].toString();
backdropMD5 = GeneralFunctions::hashMD5(tmdb->t_infosList["backdrop"].toString());
posterPath = tmdb->t_infosList["poster"].toString();
posterMD5 = GeneralFunctions::hashMD5(tmdb->t_infosList["poster"].toString());
collection = tmdb->t_infosList["collection"].toString();
QStringList genres = tmdb->t_infosList["genres"].toStringList();
genre = genres[0];
for(int i=0 ; i<genres.size() ; i++)
{
genre =genre + ", " + genres[i];
}
} |
Merci de votre aide.
Cordialement