ada10 (5th August 2010)
I am really not happy with the scroll effect or "fly-in" effect using the following code -
QPropertyAnimation *animation = new QPropertyAnimation(mSlideWidget, "geometry");
animation->setDuration(500);
//Now animation to provide a fly-by effect
QRect startRect(80,0,0,300);
QRect endRect(80,0,500,300);
animation->setStartValue(startRect);
animation->setEndValue(endRect);
animation->start();
Its not as I want it to be.It should have a kind of slide- out effect from the position (x,y) = (80,0). Beyond that; that x < 80, it should not be visible. Can u please suggest how to do this ?
Currently the above code "expands" the widget from 0 width to width 500 which is not exactly what i want.
Hi, try
The widget should then move with fixed size and not expand from zero size.Qt Code:
To copy to clipboard, switch view to plain text mode
Ginsengelf
edit: ah, did not read correctly: this will not fly-in from x=80.
Last edited by Ginsengelf; 6th August 2010 at 11:08. Reason: updated contents
I tried giving a negative x value only to find a displeasing effect ... any other way to do this ?![]()
It should be like in this page -
http://www.building58.com/examples/tabSlideOut.html
Your examlpe could be achieved with the solution Ginsengelf. Or you have to set a mask to your widget and animate that.
I tried out the solution with starting rectangle QRect startRect( -420,0,500,300 ). Sure this works fine, but I would like how to set the mask so that the widget is visible only after its x >= 80
I was able to manage masking a particular region of the widget using setMask(). I have a small query regrading this. I want the masked region to remian valid even after the slide -out window is translated ( or moved ). How do I ensure this ?
Bookmarks