-1

I tried drawing in a QPixmap in worker thread . It works as expected . But as per documentation it is not recommended to draw in worker thread . What are the consequences of creating and adding in background thread?

How do i measure the rendering time or time taken to add an item to graphics scene in Qt?

Akshaya S
  • 1
  • 2
  • Could you please link the piece of documentation you are referring? Moreover, you talk about *add[ing] an item to graphics scene* but without making it clear if you are using `QGraphicsScene`; if it is the case, seeing how you tagged your question with `qwidget`, do you mean you have a `QGraphicsView`? There is a `qgraphicsview` tag that you did not use and all the little things make your question unclear... The devil is in the details... – Atmo Aug 31 '23 at 15:09
  • 1
    From the [`Qt5` doc. "Painting in Threads"](https://doc.qt.io/qt-5/threads-modules.html#painting-in-threads): `"QPainter can be used in a thread to paint onto QImage, QPrinter, and QPicture paint devices. Painting onto QPixmaps and QWidgets is not supported"`. [`Qt6`](https://doc.qt.io/qt-6/threads-modules.html#painting-in-threads) rewords this slightly as `"QPainter can be used in a thread to paint onto QImage, QPrinter, QPicture, and (for most platforms) QPixmap paint devices"` but, without a list of supported platforms I really don't see any practical difference. – G.M. Sep 02 '23 at 10:04

0 Answers0