Re: QPainter and C function
you can't really.
(Unless you provide a C interface that calls QPainter for you and call that (new) interface from your C code... but if you have to modify the C code, why not turn it into C++ right away?)
Re: QPainter and C function
The code is very big with lot of global variables so it is difficult to rewrite it in c++.But I can modifie the c code to call a draw line function but I dont know how to do that...
Re: QPainter and C function
The only way is to provide some global environment on which the C functions can operate but that's a very ugly solution.
Code:
void drawLine(int x1, int y1, int x2, int y2){
globalPainter->drawLine(x1, y1, x2, y2);
}
Of course the painter has to be properly initialized and it can't operate on QWidget.
Re: QPainter and C function
I find a solution.
I stock a global list of points computed from my C function call from QPainter. And I return than to qpainter to display them.