Hi,

In another post I asked how to have a QMovie as a background of a QDialog. I managed that (thanks to the forum) but QMovie does not load mp4 or avi videos. I tried with Phonon::VideoPlayer however when I try to add the layout to the VideoPlayer the output is not correct (see image below). Here is the code:

Qt Code:
  1. player = new Phonon::VideoPlayer(Phonon::VideoCategory, this);
  2.  
  3. mainlayout = new QVBoxLayout();
  4.  
  5. mainlayout->setContentsMargins(0, 0, 0, 0);
  6. mainlayout->addWidget(ui->label_3);
  7.  
  8. gridLayout = new QGridLayout();
  9.  
  10. verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
  11. gridLayout->addWidget(ui->label, 2, 0, 1, 1);
  12. gridLayout->addWidget(ui->label_2, 3, 0, 1, 1);
  13. gridLayout->addWidget(ui->progressBar, 2, 1, 1, 1);
  14. gridLayout->addWidget(ui->progressBar_2, 3, 1, 1, 1);
  15. gridLayout->addWidget(ui->lblproc, 1, 0, 1, 2);
  16. gridLayout->addItem(verticalSpacer, 0, 0, 1, 1);
  17.  
  18. mainlayout->addLayout(gridLayout);
  19.  
  20. delete player->layout();
  21. player->setLayout(mainlayout);
  22.  
  23. bkgLayout = new QVBoxLayout(this);
  24. bkgLayout->addWidget(player);
  25.  
  26. Phonon::MediaSource source("./mellow-meadow.mp4");
  27. player->load(source);
  28. player->play();
To copy to clipboard, switch view to plain text mode 

Here is the image showing the result. The video appears very small as a black box with the yellow bar. It should cover the whole dialog and the set of widgets on top of the video.
image.jpg

Any idea how to make it work? Or which widget to use?

Many thanks,
Carlos.