JasonGenX
JasonGenX

Reputation: 5444

QObject::connect simply “rejects” my object at compile-time(!)

C is a QObject derived class, I can use it successfully.

I get a compilation error on the “connect”. If i’d change “this->controller”, to “this”, on the target, it will work fine. Something about the this->controller as the recipient causes this not to compile. I realize it must be something stupid, but the cause evades me...

MyClass::MyClass(C * controller)
    : QThread(NULL)
{
    this->controller = controller;
    QObject::connect(this, SIGNAL(OnResponse(ResponseClass*)), this->controller, SLOT(OnResponse(ResponseClass*)));  // <---- "Compiler error: " error: no matching function for call to...."
}

Upvotes: 1

Views: 162

Answers (1)

JasonGenX
JasonGenX

Reputation: 5444

MY bad. The class of "this->controller" was declared with a forward declaration only due to circular referencing of *.h files. That caused the problem. Not much the compiler could do with it.

Upvotes: 2

Related Questions