PDA

View Full Version : How to embed a QAxWidget into QGraphicsProxyWidget?



Junan
21st August 2013, 15:02
Hi, all,

I want to embed a QAxWidget into QGraphicsProxyWidget use the following code:



QGraphicsScene *scene = new QGraphicsScene(0, 0, 800, 600);
QGraphicsView *view = new QGraphicsView(scene);
QAxWidget *widget = new QAxWidget();
widget->setControl(QString::fromUtf8("{6BF52A52-394A-11d3-B153-00C04F79FAA6}")); //Windows Media Player CLSID or Other ActiveX CLSID
QGraphicsProxyWidget *proxy = scene->addWidget(widget);
proxy->setFlags(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemIsSelectable);
view->setScene(scene);
view->show();


now, any operation on this widget is invalid.just like the widget is disabled. Any suggestions what I have to do?

Best regards,

Junan

d_stranz
23rd August 2013, 17:07
RTFM: From QGraphicsScene::addWidget:


Note that widgets with the Qt::WA_PaintOnScreen widget attribute set and widgets that wrap an external application or controller are not supported. Examples are QGLWidget and QAxWidget.