Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Playing a Video file(.wmv) in the entire dialog window

Playing a Video file(.wmv) in the entire dialog window

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    M_31
    wrote on last edited by
    #1

    I want to play the video file in my dialog window. I used the following codes in my program and its playing on left corner of my dialog window with the size of 32*32 , but i want to play the video on my entire Dialog window.

    @ //TestDlg.h
    #include <QDialog>

    namespace Ui {
    class TestDlg;
    }

    class TestDlg : public QDialog
    {
    Q_OBJECT

    public:
    explicit TestDlg(QWidget *parent = 0);
    ~TestDlg();

    Phonon::MediaObject *obj_MediaObject;
    Phonon::VideoWidget *wid_videoWidget;
    Phonon::AudioOutput *aio_audioOutput;
    

    private:
    Ui::TestDlg *ui;
    };
    @
    @
    //TestDlg.cpp
    TestDlg::TestDlg(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::TestDlg)
    {
    ui->setupUi(this);

    // setup the objects:
    obj_MediaObject = new Phonon::MediaObject(this);
    wid_videoWidget = new Phonon::VideoWidget(this);
     aio_audioOutput = new Phonon::AudioOutput(Phonon::VideoCategory,this);
    //clear the mediaobject:
    obj_MediaObject->clearQueue();
    //Put a video in the queue:
    obj_MediaObject->enqueue(Phonon::MediaSource("C:\\Wildlife.wmv"));
    //make the proper connections:
    Phonon::createPath(obj_MediaObject, wid_videoWidget);
    // to link the mediaobject with the video widget.
    Phonon::createPath(obj_MediaObject, aio_audioOutput);
    // to link the mediaobject with audio output.  
    

    //play the video:
    obj_MediaObject->play();

    }
    @

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      You didn't use a layout in your dialog. By default a widget will be placed at the top right then.

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved