February 7, 2011

Jakob Schou Jakob Schou
Lab Rat
16 posts

Show/hide of window containing QGLWidget fails on remote X server


I have a window (QMainWindow or QDialog) with a QGLWidget. If I call hide() and then show() on the window I will get the following error when running in an X windows system (remote: linux server, mac client):

X Error: GLXBadContext 147 Extension: 146 (Uknown extension) Minor opcode: 5 (Unknown request) Resource id: 0xa0001c

(and nothing is rendered)

Any ideas what could cause this behavior?

1 reply

March 15, 2012

artem.marchenko artem.marche..
Lab Rat
54 posts

I’ve got same problem in the same environment (local Mac, remote – Linux box).

What I do is I am creating a QDeclarativeView (actually QApplicationViewer that QtCreator’s wizard constructs) and use QGLWidget as a viewport in the following manner:

  1. QmlApplicationViewer viewer;
  2. ...
  3. viewer.setViewport(new QGLWidget);
  4. ...
  5. viewer.setResizeMode(QDeclarativeView::SizeRootObjectToView);
  6. ...
  7. viewer.setFrameStyle(0);
  8. viewer.setAttribute(Qt::WA_OpaquePaintEvent);
  9. viewer.setAttribute(Qt::WA_NoSystemBackground);
  10. viewer.setAttribute(Qt::WA_DeleteOnClose);
  11. viewer.setStyleSheet("background: transparent; border: none");
  12. viewer.setWindowFlags(Qt::FramelessWindowHint);
  13. viewer.setMainQmlFile(QLatin1String("qml/twclientqml/TwClient.qml"));
  14. viewer.showFullScreen();

What could this message actually mean? OpenGL initialization failed and system falls back to raster?

  ‹‹ looking for nice tutorials for 3D graphics wrt shader development, portability between openGL w/ openGL ES code      QObject ››

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