Layout problems when switch from QWidget to QGraphicsItem

qt

Solution

`QGraphicsLayout` and `QGraphicsLayoutItem` are what you are looking for.

http://doc.qt.io/qt-4.8/qgraphicslayout.html

http://doc.qt.io/qt-4.8/qgraphicslayoutitem.html

Hope that helps.

Problem

I'm switching a timeline viewer from QWidget to QGraphicsItem, because QWidget is too heavy, I got performance issues when there are thousand of QWidgets. I need Layout Management. But I found QGraphicsItem was so light, that it did't support layout. I should use QGraphicsWidget, but there are many useful QGraphicsItem's subclasses, QGraphicsWidget doesn't have them. I think QGraphicsProxyWidget isn't the answer because it is already too slow when I using QWidgets... So, is there any way to have a layout with any QGraphicsItem? Or is there a better solution?

Original source