I've created the myClass
class and in order to hide members, used d-pointer but got error while compiling my souce code. Here is the code:
Header file:
class myClassPrivate;
class myClass : public QObject
{
Q_OBJECT
public:
myClass(QObject *parent = 0);
~myClass();
...
signals:
public slots:
private:
myClassPrivate *d;
};
and related .cpp
myClass::myClass(QObject *parent):
QObject(parent),
d(new myClassPrivate())
{
}
myClass::~myClass()
{
delete d;
}
class myClassPrivate
{
public:
myClassPrivate();
...some methods...
QTextStream stream;
QFile* m_File;
};
myClassPrivate::myClassPrivate():
m_File(new QFile)
{
}
It says: forward declaration of 'struct myClassPrivate'; invalid use of incomplete type 'myClassPrivate'