I'm new here on the forum and I need some answers as to what I have done wrong in my coding.
I usually code in Java, C# and some extend of C++ so I might have mixed something out.
What I'm trying to do is to create a class that have stores threads of a custom class into a LinkedList.
The error that I came out is Error 1 error C2248: 'QObject::QObject' : cannot access private member declared in class 'QObject' c:\qt\4.4.3\src\corelib\thread\qthread.h 132
I myself think that the error is caused by the incorrect use of the LinkedList append method in the listClass add method, any help would be appreciated.
This is not the complete/original code but it's fairly similar except having the includes.
{
Q_OBJECT
public:
CustomObj();
protected:
void run();
}
CustomObj::CustomObj()
{
}
void CustomObj::run()
{
}
class CustomObj : public QThread
{
Q_OBJECT
public:
CustomObj();
protected:
void run();
}
CustomObj::CustomObj()
{
}
void CustomObj::run()
{
}
To copy to clipboard, switch view to plain text mode
class listClass
{
public:
listClass();
void add(CustomObj cus);
private:
QLinkedList<CustomObj> *list;
}
listClass::listClass()
{
list = new QLinkedList<CustomObj>;
}
void listClass::add(CustomObj cus)
{
list->append(cus);
}
class listClass
{
public:
listClass();
void add(CustomObj cus);
private:
QLinkedList<CustomObj> *list;
}
listClass::listClass()
{
list = new QLinkedList<CustomObj>;
}
void listClass::add(CustomObj cus)
{
list->append(cus);
}
To copy to clipboard, switch view to plain text mode
Bookmarks