Hi,
I am using QGraphicsTextItem to display a text that is continiously being updated at a given time interval. i am calling the setPlainText to set the text. It is observed on each call to setPlainText the memory used by the application keeps increasing.

Below is a sample code where this issue can be noticed. you can notice the memory used by the application in windows task manager.
Qt Code:
  1. #include <QtGui/QApplication>
  2. #include <QGraphicsView>
  3. #include <QGraphicsTextItem>
  4. #include <QTimer>
  5. #include <limits>
  6.  
  7.  
  8. int main(int argc, char *argv[])
  9. {
  10. QApplication a(argc, argv);
  11. QGraphicsView view(&scene);
  12. pItem.setPlainText("This is a text");
  13. scene.addItem(&pItem);
  14. view.show();
  15. QString strText("text");
  16. double i = 0;
  17. while(i<std::numeric_limits<int>::max())
  18. {
  19. pItem.setPlainText(strText + QString::number(i));
  20. QApplication::processEvents();
  21. i++;
  22. }
  23. scene.removeItem(&pItem);
  24. return a.exec();
  25. }
To copy to clipboard, switch view to plain text mode 

I am using Qt 4.6.2 on windows vista
visual studio 2008.

tia,