Adding QGraphicsProxyWidget items into QGraphicsScene
Hello,
I have got several widgets which I should add into a GraphicsScene...
I found a new class in Qt4.4 "QGraphicsProxyWidget " that makes easier adding widgets into graphicsscene .
I succesfully added most of my widgets as in the embeddeddialogs example of qt; but on some of my widgets I use QGLWidget to make some drawings. At that point qt gives a warning and that widget is not shown on the screen:
QPainter::begin: A paint device can only be painted by one painter at a time
I am adding the widgets as follow:
Code:
CustomProxy *proxy = new CustomProxy(0, Qt::Window);
myDialog *dialog1=new myDialog;
proxy->setWidget(dialog1);
scene.addItem(proxy);
Should i use a different design pattern? Any idea?..
Thanks, regards..
Re: Adding QGraphicsProxyWidget items into QGraphicsScene
As far as I know currently you shouldn't add GL widgets to graphicsview. You can instead add a custom widget with a GL context where you will render its content to a pixel buffer and then render the resulting pixmap as the item in graphics view.
Re: Adding QGraphicsProxyWidget items into QGraphicsScene
hi,
I am rendering a pixmap image using a proxy widget. Take a look at the /examples/graphicsview/pad_navigator example 'roundrectitem'.
Re: Adding QGraphicsProxyWidget items into QGraphicsScene
I think , you are right; i converted tht qglwidget to qwidget, and it worked. It would be nice if graphicsview supported qglwidgets. Anyway...