PDA

View Full Version : youtube fullscreen effect for a widget



cyrfer
31st December 2009, 08:30
Hi,
I'm trying to make a widget be fullscreen that is initially part of a form, much like a youtube of vimeo widget is small at first, then you click a button to make it become fullscreen. My attempts to do this are listed below:

When I create the Phonon::VideoPlayer instance, the widget is part of a form (added to a Layout). The VideoPlayer widget appears in the correct position, and also plays the media correctly. However, I have a pushbutton to help me toggle the widget into fullscreen mode. This callback has code which set's the VideoPlayer's parent to NULL and removes it from the form's Layout. After the VideoPlayer widget has been liberated, i call it's ::showFullScreen member function. Should this be enough to see the widget as fullscreen?

Thanks!

cyrfer
5th January 2010, 10:03
I was able to get the Phonon::VideoPlayer widget to correctly showFullscreen() by removing the parent, but to make the widget return to the parent when the user hits the Escape key has been hard. It seems like there should be a signal I can catch when fullscreen is toggled. If I could connect to it, I could use the default key event implementation (for PopUps) that correctly makes the widget showNormal() when a user hits the Escape key, so that I could re-parent the widget in the form. I didn't find this signal, which means I have to handle the key event myself, which brought up other problems. This whole things seems like it should be really simple and a FAQ. Has anyone tried to do it yet?

nikhilqt
5th January 2010, 13:57
Hey!

When you a press a pushbutton for fullscreen, do not set the parent NULL to a widget which is inside already, instead create a one more widget make the parent NULL and make it to showfullscreen. When user clicks escape delete the newly created widget.