qglwidget

How to fullscreen a QGLWidget?

烂漫一生 提交于 2019-11-30 19:53:27
I am new to OpenGL and Qt, and I am learning both simultaneously(3 days already:). I couple of years ago I did some exmerimenting with DirectX and I clearly remember that it was possible to make a full-screen window there. By full-screen I mean really full-screen, even without the top part where you have the close fullscreen and minimize buttons. I have this program so far: #include <QApplication> int main(int argc, char** argv) { QApplication app(argc, argv); QGLWidget w; w.show(); return app.exec(); } What should I add to it to make w full-screen? Martin Beckett showFullScreen() Although I

When is QGLWidget's paintGL called?

隐身守侯 提交于 2019-11-29 10:02:00
All I can find is "whenever the widget needs to be painted." When is that, specifically? When you call updateGL() on your widget (or update() ), or just Qt decides to redraw your widget. Reasons why Qt might choose to ask for a redraw include: your widget gets resized your widget is hidden and shown again your widget is minimized and then restored something else is put in front of your widget and then moved away the Moon is in the third quarter a distant butterfly had flapped its wings ... In short, you have very little control about when Qt asks for a repaint. Just be sure to paint fast! :-)