1

Right, so I have a 100-200 QRectItems with the child being QWidget that has a few QLineedits/checkboxes/etc/etc.

I run into issues that if there are a lot of items on the screen and I zoom out the performance drop a lot. Down to "1" fps. When I see all 150 items then it lags like hell.

Does any know of any optimization methods that I could implement?

At the moment I have set up a zoom function and after certain zoom I simply hide the QWidget and leave QRectItem only visible. That brings back performance but sadly I lose the widgets at that zoom level...

Dariusz
  • 960
  • 13
  • 36
  • This blog post might interest you (especially the section titled "Graphics View supports embedding QWidgets"): http://blog.qt.io/blog/2017/01/19/should-you-be-using-qgraphicsview/ It sounds to me like if you want performance, you shouldn't include any QWidgets in your QGraphicsView (i.e. you'd need to reimplement their functionality using QGraphicsItems instead) – Jeremy Friesner Feb 06 '17 at 00:47
  • Interesting, just watched the video presentation and so on. Will look in to it. About reimplementing widgets in QGraphicsItem... what do you mean by that? – Dariusz Feb 06 '17 at 10:08
  • 1
    I mean that if you want something in your QGraphicsView that looks like a QLineEdit/QCheckBox/etc, and you also want high performance, that instead of actually adding in a QLineEdit/QCheckBox/etc using QGraphicsProxyWidget you would need to create your own subclasses of QGraphicsItem that look and act as much like QLineEdit/QCheckBox/etc as you can manage without actually being them, and use those instead. Or perhaps someone has already done this and posted the code somewhere, I don't know. – Jeremy Friesner Feb 06 '17 at 15:13

0 Answers0