我有一个无法触及但必须向其添加功能的库的头文件。所以我只会将AA类继承到库中。但是遇到类指针和构造函数的问题。不知道如何架起通往它的桥梁。
class AA : public QObject
{
Q_OBJECT
public:
static AA* GetInstance();
private:
explicit AA(QObject* parent = 0);
};
class BB : AA
{
private:
explicit BB(QObject* parent = 0):AA(parent)
{
//some more functionality added once this class is instantiated.
}
}
class CC : BB
{
...
connect(BB::GetInstance(),
SIGNAL(cxOnline(bool)),
this,
SLOT(OnCxOnline(bool))); //this error out: static AA* AA::GetInstance() is inaccessible within this context
...
}