QPainter error: no match for call ...
If I have a private QPainter :
QPainter the_painter;
If I use at paintEvent :
void AnalogClock:: paintEvent(QPaintEvent *)
{
the_painter(this);
....
I have :
error: no match for call to '(QPainter) (AnalogClock* const)'
I dont understand what is happen.
Any idea?
Re: QPainter error: no match for call ...
The compiler is certainly right. This call:
is a function call of a function called "the_painter" passing it a "this" argument.
I know you meant to call a constructor but the object is already constructed, you can't call a constructor directly in this context. Use QPainter::begin() (and then QPainter::end()) or don't store the painter as a member variable but instead create a local variable in the event handler.
Re: QPainter error: no match for call ...