1

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?

Scrathis
  • 79
  • 1
  • 10

1 Answers1

0

Which version are you using ?

I propose you a solution you have to test. When you want to fullscreen, try to make a copy of you content (if the video is in a widget, open a new QWidget and copy the content to the new widget), you'll in theory have 2 widgets with the same content, but you shouldn't have to hide and reduce size of anything. Tell me if it worked for you.

Secondly, look at these post, could be usefull:

Finaly, read again, you could have missed something :/ http://doc.qt.io/qt-5/qwidget.html#showFullScreen

Tell me if I misunderstood something, or if anything (and what) helped.

Community
  • 1
  • 1
Max13
  • 800
  • 2
  • 7
  • 27
  • I think your suggestion makes sense to me. I am trying to implement this in my app. I will let you know how things go. – Scrathis Dec 08 '11 at 18:37
  • I have implemented the fullscreen toggling using the method you suggested. It works well so far. Thank you very much.@Max13 – Scrathis Dec 14 '11 at 15:57