I have added QTextEdit to QGraphicsScene. How now to access the properties and methods of the widget?
QGraphicsScene scene;
QTextEdit *te=new QTextEdit();
scene.addWidget(te);
................................
foreach(auto item,scene.items()) {
auto te=(QTextEdit*)item;
auto isReadOnly=te->isReadOnly(); // Error
}
QGraphicsScene::addWidgetreturns aQGraphicsProxyWidgetwhich, as its name suggests, acts as a proxy to the widget added (yourQTextEditin this case). So you can either save the proxy for use later...or, when looping over items, use something like...