PDA

View Full Version : QPainter, drawing text, high mem leak ?



mirex
19th September 2014, 16:52
Just simple function causes app to grow memory very fast ( even 300 kb per sec at 100 updates or so ? )



void canvas_put_text(struct canvas *pcanvas, int canvas_x, int canvas_y,
struct color *pcolor, const char *text)
{
QPainter p;
QPen pen;
QColor color(pcolor->qcolor);

pen.setColor(color);

p.begin(&pcanvas->map_pixmap);
p.setPen(pen);
p.drawText(canvas_x, canvas_y, QString(text));
p.end();

}


If i just comment out drawText then everything its ok. text is very small and fits to pixmap.

So, any ideas ??
Maybe there is other way just to put text to QPixmap ?

I tried with QPainterPath and its ok, but text is damn ugly ....

mirex
19th September 2014, 23:22
nvm, it looks like its qt5.4alpha issue only