I am currently developing a media player using Qt. One of the common features required is to be able to toggle full screen.
The rendering canvas essentially is a QGLWidget(I subclassed from it). It is added to a application window which is the main window for this media player. Besides the rendering canvas, the application window has toolbar, status bar and other small widgets. The full screen I want to implement is to make the rendering canvas occupying the full screen without other widgets being visible. Meanwhile, I can still trigger events by pressing keys.
I have tried reset the parent of the rendering canvas to 0 and call the showFullScreen() function. And I called the hide() on the application window. This makes the canvas occupy the entire screen which is expected. However, the application is not grabbing any key press event. As a result, I cannot get back to the normal. Plus, the canvas background is flashing between black and white(default background is white).
Anyways, I don't think the way I have tried is the best way to implement this. Since there will be some complex reparenting going on when I switch back to normal. And the whole application become hard to manage because there will be some tasks to be performed while being full screen such as viewing piexl values(the source is raw).
Can anybody suggest a better way to implement the toggling of full screen?