PDA

View Full Version : conversion to 'const QObject *' exists, but is inaccessible



big_buka
24th March 2013, 11:41
In my project i have class Scheduller(.h is below)


class Scheduller : QObject
{
Q_OBJECT
protected:
Scheduller();
~Scheduller();
static Scheduller* _instance;
static int _instanceCount;
void timerEvent(QTimerEvent *event);
public:
static Scheduller* getInstance();
static void freeInstance();
private:
int cuurentTimerID;
QList<SchedulerTask> tasks;
QApplicationSettings* settings;
void checkTasks();
public slots:
void UpdateTasks();
};
To copy to clipboard, switch view to plain text mode
In some other part of code i have


QObject::connect(this,SIGNAL(tasksChanged()),sched uller,SLOT(UpadteTasks()));
To copy to clipboard, switch view to plain text mode
I dont understand why compiler says me
error C2243: 'type cast' : conversion from 'Scheduller *' to 'const QObject *' exists, but is inaccessible
Could any one explain why this happend and how to fix this ?
The answer
hooly s**t....
The answer is because the default inheirt type it private....
class Scheduller : public QObject
sory for making a thread. It may be deleted....