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)
{
pen.setColor(color);
p.begin(&pcanvas->map_pixmap);
p.setPen(pen);
p.
drawText(canvas_x, canvas_y,
QString(text
));
p.end();
}
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();
}
To copy to clipboard, switch view to plain text mode
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 ....
Bookmarks