PDA

View Full Version : Suggestions Requested



NIteLordz
8th February 2015, 16:43
Given a button a that when clicked displays a menu of Actions...

Action A
Action B
Action C
...
Action N

when clicking on any action, i want to slide in from the right a panel of widgets. This panel should then have the ability to return to the top level Actions.

I have seen some examples of a sliding menu, however, this isn't quite what i want/need. The only visible area is a 300x300 area, so the panels that slide in, are not visible, until they slide in, and while they slide in, the top level menu slides out of this view rectangle to the left.

any suggestions ?

d_stranz
8th February 2015, 19:39
I would create the panel of widgets inside a QWidget / QFrame or something like that, set its position to offscreen to the right, then use a QPropertyAnimation to animate the position to slide it in. At the same time, slide the top level menu out to the left by the same amount using another animation on its position property.


This panel should then have the ability to return to the top level Actions.

Not sure what you mean by this. If you mean that clicking on a widget within the panel causes the panel to slide back out again, then use a similar animation in a slot connected to the click to slide it back out and then hide it when the animation finishes, and a parallel animation to slide the top level menu back in.

NIteLordz
8th February 2015, 19:42
Thanks, that is what I was thinking, just looking for some validation, and to make sure I wasn't missing something.

And yes, concerning the top level quote, that means to be able to slide back yo the original position.