Results 1 to 2 of 2

Thread: how to run a movie on QLabel

  1. #1
    Join Date
    Jul 2010
    Posts
    50
    Thanks
    7
    Platforms
    Windows

    Default how to run a movie on QLabel

    void MainWindow:penFileDialog()
    {
    QString fileName = QFileDialog::getOpenFileName(this, tr("Open Image"), "c:/", tr("Image Files (*.png *.jpg *.bmp *.avi)"));
    movie = new QMovie(fileName);
    movie->setFileName(fileName);
    label->setMovie(movie);
    movie->start();
    workspace->addWindow(label);
    label->show();
    }

    On executing this function, an image is getting opened but a video is not getting opened(only blank label is displayed).
    Please help........
    aman.taneja.2008@gmail.com

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to run a movie on QLabel

    Which file did you open ? .avi cant be played in QLabel.
    QMovie is usually supposed for .gif files

    Check the Video player example in Qt demos which uses Phonon for playing movie files.

Similar Threads

  1. QThread for Movie Player...
    By jiapei100 in forum Qt Programming
    Replies: 1
    Last Post: 29th September 2009, 20:55
  2. Replies: 1
    Last Post: 29th September 2009, 19:44
  3. To Play Movie in QT 4
    By Isa in forum Qt Programming
    Replies: 8
    Last Post: 2nd August 2008, 11:56
  4. playing a movie in a label
    By csvivek in forum Qt Programming
    Replies: 2
    Last Post: 20th May 2008, 09:04
  5. Play a movie in a widget
    By Deepak Mishra in forum Qt Programming
    Replies: 2
    Last Post: 1st November 2007, 06:39

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.