#include <QtGui/QApplication>
#include<QWidget>
#include<QHBoxLayout>
#include<QLabel>
#include<QMovie>
#include<QPushButton>
#include<QSlider>
int main(int argc, char *argv[])
{
slider->setMinimum(0);
slider->setMaximum(200);
if (movie->isValid())
label->setMovie(movie);
else
label->setText("asdfasdf");
QObject::connect(play,
SIGNAL(clicked
()),movie,
SLOT(start
()));
QObject::connect(stop,
SIGNAL(clicked
()),movie,
SLOT(stop
()));
QObject::connect(slider,
SIGNAL(valueChanged
(int)),movie,
SLOT(setSpeed
(int)));
lay->addWidget(label);
lay->addWidget(play);
lay->addWidget(stop);
lay->addWidget(slider);
win->setLayout(lay);
win->show();
return a.exec();
}
#include <QtGui/QApplication>
#include<QWidget>
#include<QHBoxLayout>
#include<QLabel>
#include<QMovie>
#include<QPushButton>
#include<QSlider>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWidget *win=new QWidget();
QHBoxLayout *lay=new QHBoxLayout();
QPushButton *play=new QPushButton("PLAY");
QPushButton *stop=new QPushButton("STOP");
QSlider *slider=new QSlider();
slider->setMinimum(0);
slider->setMaximum(200);
QLabel *label=new QLabel;
QMovie *movie = new QMovie("anim03.gif");
if (movie->isValid())
label->setMovie(movie);
else
label->setText("asdfasdf");
QObject::connect(play,SIGNAL(clicked()),movie,SLOT(start()));
QObject::connect(stop,SIGNAL(clicked()),movie,SLOT(stop()));
QObject::connect(slider,SIGNAL(valueChanged(int)),movie,SLOT(setSpeed(int)));
lay->addWidget(label);
lay->addWidget(play);
lay->addWidget(stop);
lay->addWidget(slider);
win->setLayout(lay);
win->show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks