Results 1 to 2 of 2

Thread: QPainter, drawing text, high mem leak ?

  1. #1
    Join Date
    Sep 2014
    Posts
    3
    Platforms
    Unix/X11

    Default QPainter, drawing text, high mem leak ?

    Just simple function causes app to grow memory very fast ( even 300 kb per sec at 100 updates or so ? )

    Qt Code:
    1. void canvas_put_text(struct canvas *pcanvas, int canvas_x, int canvas_y,
    2. struct color *pcolor, const char *text)
    3. {
    4. QPen pen;
    5. QColor color(pcolor->qcolor);
    6.  
    7. pen.setColor(color);
    8.  
    9. p.begin(&pcanvas->map_pixmap);
    10. p.setPen(pen);
    11. p.drawText(canvas_x, canvas_y, QString(text));
    12. p.end();
    13.  
    14. }
    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 ....
    Last edited by mirex; 19th September 2014 at 16:56.

  2. #2
    Join Date
    Sep 2014
    Posts
    3
    Platforms
    Unix/X11

    Default Re: QPainter, drawing text, high mem leak ?

    nvm, it looks like its qt5.4alpha issue only

Similar Threads

  1. xorg memory leak from QPainter::drawPixmap
    By anirbanjoy in forum Qt Programming
    Replies: 4
    Last Post: 11th March 2011, 15:50
  2. Text drawing with QPainter
    By Rambobino in forum Qt Programming
    Replies: 2
    Last Post: 1st November 2010, 17:26
  3. Memory Leak with QPrinter/QPainter
    By cevou in forum Qt Programming
    Replies: 11
    Last Post: 1st June 2010, 06:24
  4. High CPU Usage in Drawing
    By lordhippo in forum Qt Programming
    Replies: 15
    Last Post: 21st May 2010, 22:48
  5. Drawing Rich Formatted Text with QPainter
    By millsks in forum Qt Programming
    Replies: 1
    Last Post: 5th March 2009, 19:59

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.