You Are Here:

Community: Wiki

This page was last modified on 31 October 2009, at 15:40.

How to use QMovie

From Forum Nokia Wiki



ID ... Creation date 18 March 2009
Platform S60 3rd Edition FP2, S60 5th Edition Tested on devices Qt Creator IDE V4.5 & S60 5th edition
Category Qt for Symbian Subcategory Application


Keywords (APIs, classes, methods, functions): QMovie,QSlider,QPushButton

Overview

This is generally used to play any kind of animated images.QMovie

When you press play the animation starts playing,when slider value is increase the animation speed get faster.

Preconditions

Comptability

  • Can be executed on Qt Creator V4.5 IDE as well as S60 platform

Various Functions

  • Sets the name of the file that QMovie reads image data from
movie->setFileName(QString str);
  • Sets the format that QMovie will use when decoding image data
movie->setFormat(const QByteArray & format);
  • Sets the scaled frame size to size.
QMovie *movie = new QMovie("c:\\data\\images\\canadagoose.gif");
QSize size(200,200);
movie->setScaledSize(size);

Image:Movui.JPG

Source Code

#include <QtGui/QApplication>
#include "widget.h"
#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("C://Documents and Settings//Viral//My Documents//Qerrormsg//Movie//canadagoose.gif");
label->setMovie(movie);
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();
}

Screenshot

More About QMovie visit:QMovie

Image:Impvira.JPG

More About QMovie visit:QMovie

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fHttpE3aE2fE2f217E2e218E2e225E2e2E3a2082E2findeE78E2ehtmlE253FX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ
User Rating: qfnZuserE5FratingQNx4E2E0000X