Qt World Summit: Submit your Presentation

QVideoWidget black window

  • I have added QVideoWidget as a child to QWidget, and I am trying to play local avi file, but without success. Here is the code:

    #include "widget.h"
    #include <QApplication>
    #include <QtWidgets>
    #include <QtMultimediaWidgets>
    int main(int argc, char *argv[])
        QApplication a(argc, argv);
        Widget window;
        window.resize(320, 240);
        window.setWindowTitle(QApplication::translate("childwidget", "Child widget"));
        QMediaPlayer *player = new QMediaPlayer;
        QMediaPlaylist *playlist = new QMediaPlaylist(player);
        QVideoWidget *videoWidget = new QVideoWidget(&window);
        videoWidget->resize(320, 240);
        return a.exec();

    I included multimedia, multimediawidgets and widgets in my .pro file.

    Also gstreamer packages are installed with sudo apt-get install gstreamer* libgstreamer* and version is 0.10.

    I am running Debian Wheezy on VMWare and trying to build that code for i386 Desktop machine.

    Am I missing something important so this code won't work? Only I get is black QVideoWidget window inside parrent QWidget.

  • @Zola Have you find a solution ?

  • @mehmety888, this thread is over 2 years old. If they did they would of said they did find a solution. By the way you mean found not find.

Log in to reply