September 21, 2010

achibana achibana
Lab Rat
1 posts

How to use QGLPixelBuffer or QGLFramebufferObject in QGraphicsItem paint

 

As we know in QGraphicsScene and QGraphicsView, there are many QGraphicsItems. in the MyQGraphicsItem::paint(QPainter *pxPainter, const QStyleOptionGraphicsItem *pxOption, QWidget *pxWidget) implement, we use the pxPainter to draw image(QImage) or PixelMap(QPixMap). when we set the graphicsView->setViewport(new QGLWidget), we use the OpenGL paintEngine, but we can not use the QGLPixelBuffer or QGLFramebufferObject being the paintDevice. Is there any solution to support? for the QGLFramebufferObject is more efficient as described.

2 replies

September 23, 2010

Student3000 Student3000
Lab Rat
2 posts

me have some similar problem

Why QGLFramebufferObject in QGraphicsItem don’t work?
http://developer.qt.nokia.com/forums/viewthread/984/ [developer.qt.nokia.com]

September 25, 2010

achibana achibana
Lab Rat
1 posts

Thanks for your referance, so we just ignore the pxPainter in the parameters and paint ourselves.

Another issue is how to handle the zOrder of the GraphicsItems, or some composition of images.

I’v tried bindTexture to the QGLFramebufferObject, seems not work.

 
  ‹‹ QTcpSocket states on Windows and Linux      QUdpSocket::setProxy crash ››

You must log in to post a reply. Not a member yet? Register here!