PDA

View Full Version : Designing a "slide-out" effect



Gray
26th September 2007, 11:44
Hi everyone !

I'm quite new to QDockWidget and floatable stuff (rather using layouts in an one-window design) and hope you can give me some help.

I need to design a sort of slide-out effect. I mean: there's a main window, quite normal and simple. And depending on what user wants to show, additional widgets appear from the border of it, sliding out from inside it (they're not showed before they slide out).
I managed to do something that looks like this with a QDockWidget set to floatable and with no feature. So I get a kind of second window which can be shown or hidden, sliding out with a QTimeLine arrangement. The problem is that this window is always on top of the main window. Then, what happens is that:
1 - the dock widget shows up, on top of the main window
2 - it slides out.

I would like the main window to stay on top of this sliding widget, to keep the desired effect. How can I do this ? I tried activateWindow, stackUnder, giving the StayOnTop hint to the mainWindow...but none of these tries worked. Any idea, anyone ? :confused:

Thanks in advance ! :)

PS: I'm not afraid of designing the widget myself, so don't hesitate if the idea is not straight-forward, or even a kind of hack ;)

wysota
26th September 2007, 11:52
First you might want to try qRollEffect() (or something like that), it's defined in qeffects file (it's not part of public API so you have to look into sources). If that doesn't suit you, you can implement something similar just with a different effect.