PDA

View Full Version : how to animate a subclassed widget



babu198649
31st December 2007, 11:34
hi
how to animate a subclassed widget.

marcel
31st December 2007, 11:37
Your question is as ambiguous as it can be.
Post some code or explain what you did and what you are trying to do.

babu198649
31st December 2007, 12:22
class C_Widget : public QWidget
{
public:
C_Widget() :
QWidget()
{
QWidget w;
}
};

int main(int argc, char **argv)
{
QApplication app(argc, argv);
C_Widget w;
w.show();
return app.exec();
}



how to animate the Object of the class C_Widget inside the QGraphicsView.

i have subclassed QWidget which consists of QStackedWidget ,QTreeWidget,e.t.c.

how to animate the subclassed QWidget in another window( like QGraphicsItem's are animated in the QGraphicsView).

marcel
31st December 2007, 12:31
With Qt 4.3.x you can use the standard widget geometry functions: QWidget::move(), QWidget::resize().
Keep in mind that the parent widget must not have a layout manager in order for you to manually mode the widget.
Also, you will only be able to translate and resize the widget. No skew or rotation.

In 4.4.x you will be able to add widgets in a QGraphicsScene and apply all transformations you usually apply to QGraphicsItems.
See http://labs.trolltech.com/blogs/2007/12/19/q/ and http://trolltech.com/products/qt/whatsnew/qt44-preview

jpn
31st December 2007, 13:07
See also Fade and scroll effects.