Thanks for your suggestions.
this is where I call the constructor of popup and I get the above error message.
void Widget:n_pushButton_clicked()
{
popup popDia(this,putString);
popDia.exec();
}
Just trying to implement a call back in c++.
Thanks for your suggestions.
this is where I call the constructor of popup and I get the above error message.
void Widget:n_pushButton_clicked()
{
popup popDia(this,putString);
popDia.exec();
}
Just trying to implement a call back in c++.
What is the definition of 'Widget' ? You seem to be referring to it as a base case, but you don't seem to inherit from it?
I would recommend using functors, also known as function objects, in place of the cumbersome function pointer syntax. They are perfect for use as callbacks.
Of course, signals and slots do away with much of the need for callback functions; you can simply connect the objects that need to communicate.
You still haven't provided the definition of Widget, so its hard to help. From the error message I would guess, that you have two putString functions in Widget, and hence the compiler is unable to resolve which one to take.
As an alternative approach, apart from a functor (function object) you could also use the listener concept (i.e. observer pattern).
Bookmarks