QMovie help
-
Do someone know how to set location of QMovie object ? I added animated gif to this function and when i start my program it shows my animation on top left, but i tried with setGeometry and also setAlignment but it gave no results.
Also, do someone know how to connect this QMovie animation with QPushButton, that i click my animated duck and it disappear or does something else??
@void CFrameWnd::SukurtiAnti()
{
QMovie *movie = new QMovie(":/Antis/paveiksl/duck1111.gif");
QLabel *processLabel = new QLabel(this);
processLabel->setMovie(movie);
//processLabel->setGeometry(10,5,55,39);
//processLabel->setAlignment(Qt::AlignBottom);
movie->start();QPushButton *button = new QPushButton(this);
ui->toolBar->addWidget(button);
button->setStyleSheet("background-image: url(:/Antis/paveiksl/duck1111.gif)");
}@Here is screenshot of my duck position. http://img684.imageshack.us/i/screenshotafj.png/
-
Has "this" a layout? Just my guess...
-
This has nothing to do with QMovie. Just use a layout to manage the geometry of your widget. You can position the label any place you want it in the parent widget. It seems that you already are using Qt Designer and ui files. Why not add the QLabel you want to use for your movie there, put it in the layout you like, and simply reference the label instead of creating a new one in the code you are showing?