症状:

QPainter::begin: A paint device can only be painted by one painter at a time.

参考资料:

http://www.qtcentre.org/archive/index.php/t-20669.html

https://bugreports.qt.nokia.com//browse/QTBUG-18813

http://developer.qt.nokia.com/forums/viewthread/5412/

http://doc.trolltech.com/qq/qq26-openglcanvas.html

原因:

QGraphicsScene::addWidget() creates a QGraphicsProxyWidget which does not support widgets which draw directly onto the screen, like a QGLWidget

解决方案:

将QGLWidget设置为QGraphicsView的viewport,然后在QGraphicsView::drawBackground() and QGraphicsView::drawForeground() 中实现渲染

 

相关文章:

  • 2022-12-23
  • 2022-02-23
  • 2021-09-13
  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
  • 2021-12-05
  • 2021-08-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-18
  • 2021-12-25
  • 2021-08-03
相关资源
相似解决方案