I am making use of a QGraphicsScene
and I am adding regular widgets (QLineEdit
, QComboBox
, etc.) to it via implicitly created QGraphicsProxyWidget
objects:
m_pLineEdit = new QLineEdit("", 0);
m_pProxy = m_pGraphicsScene->addWidget(m_pLineEdit);
I am currently searching for a way to later retrieve those widgets from the scene again for processing, but am not able to find one.
I tried the following approaches already:
- Since I cannot pass the graphics scene as parent to the widget constructor, retrieving the widgets via
m_pGraphicsScene->findChildren(QLineEdit*)
does not work, since there is no direct relation. - The graphics scene does have a
QGraphicsSceneBspTreeIndex
child, but that is not part of the official Qt API and therefore relying on it cannot be the way to go.
Bottom-line: How can I get all the QGraphicsProxyWidget
objects from a Qt graphics scene? Can this be done in the Qt standard or do I have to subclass QGraphicsScene and try to manage the widgets myself?