Results 1 to 2 of 2

Thread: How to display QVideowidget on a secondary mainwindow

  1. #1
    Join Date
    May 2019
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded PyQt3 PyQt4

    Question How to display QVideowidget on a secondary mainwindow

    Qt Code:
    1. QVideoWidget *vw = new QVideoWidget() ;
    3. QMediaPlayer * mp = new QMediaPlayer(vw);
    5. QString vidstring = QFileDialog::getOpenFileName(this, "Select video file", QDir::homePath());
    7. mp->setMedia(QUrl::fromLocalFile(vidstring));
    8. mp->setVideoOutput(vw);
    9. vw->setGeometry(100, 100, 500, 500);
    10. vw->show();
    11. mp->play();
    14. }
    To copy to clipboard, switch view to plain text mode 
    [ATTACH=CONFIG]13138 i want to make the video display inside the window on the right side
    Am having two classes one contain the main window while the other also has it own window,
    whenever I play the video the Qvideowiget has it own window, I want to display the QVideowidget
    inside the second windows, but all my effect has not been fruitful... thanks in advance ```
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Graz, Austria
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Unix/X11 Windows

    Default Re: How to display QVideowidget on a secondary mainwindow

    Create the video widget as a child of the widget it should be contained in and add it to that container's layout.

    Just like with any other widget.


Similar Threads

  1. QVideoWidget Fullscreen
    By antweb in forum Qt Programming
    Replies: 11
    Last Post: 28th May 2015, 08:14
  2. About display video on the mainwindow(IPCamera)
    By kenchan in forum Qt Programming
    Replies: 0
    Last Post: 20th November 2012, 01:56
  3. Replies: 3
    Last Post: 12th July 2011, 23:55
  4. phonon on a "secondary" display (X11)
    By mnavarro in forum Qt Programming
    Replies: 10
    Last Post: 21st November 2008, 17:38
  5. Replies: 2
    Last Post: 19th November 2008, 10:01

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.