PDA

View Full Version : Overlaying Widgets on top of VideoWidget



opsimath
9th June 2010, 23:24
Hello,

My application is a Set-Top-Box demo. I'm using Phonon VideoPlayer to simply put a looping video on the screen. Easy to add a key event handler to support play/pause/mute/exit from the keyboard. Mouse swipes enable channel changing, and mouse drag up/down enable volume changing. (Demo is for a position-aware wireless remote whose dongle enumerates as a mouse and keyboard - think "Wii remote")

I'd like to display widgets on the screen in front of the video (example - volume indicator or mute indicator). In the simplest case, if I create a QSlider and parent it to the player's videoWidget(), it can be shown and hidden as expected, however its background is black. That is, the video does not show through the normally transparent background of the widget.

So I thought about writing my own slider, and using the render() method to paint my slider's background to match the underlying video. However, there is no newVideoFrame() or similar signal I can connect to which would let me trigger this on the end of a new video frame. The tick() signal does not seem to be synced to the frame (feature request).

I'd also like to put heads-up text and other things on the screen while the video plays in the background. None of these things are rectangular. :(

Is my design just something that Phonon:VideoWidget or MediaObject will not support? If not, tell me how to let the video shine through! If so, suggest some other solution. Thanks!

dvb

papius_vtualetius
11th October 2010, 17:32
see at QStackedLayout and QStackedLayout::StackingMode enum. (use QStackedWidget for ease)
put there two widgets: video widget and transparent widget with your controls and set layout's stacking mode to StackAll.

see http://doc.qt.nokia.com/4.7/qstackedlayout.html#stackingMode-prop for more detailes

TheClassic
9th June 2011, 14:29
opsimath, did papius' suggestion work?