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. QMediaPlayer Widget causes invisible window
Forum Updated to NodeBB v4.3 + New Features

QMediaPlayer Widget causes invisible window

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 514 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.
  • S Offline
    S Offline
    seang96
    wrote on last edited by
    #1

    I want to add a videoplayer inside of a qtabwidget in my .ui form file. When the program is ran (Windows 8) the program window is invisible and the video plays (you can hear it). Also, if I comment out everything after "ui->Information->addTab(videoWidget, "video");" the program's UI loads like normal and the new tab is created "video", however nothing works cause the mediaPlayer code is commented out. This is the code for the media widget:
    mainwin.h
    @private:
    QMediaPlayer mediaPlayer;@

    mainwin.cpp
    @ ui->setupUi(this);
    QVideoWidget *videoWidget = new QVideoWidget();
    ui->Information->addTab(videoWidget, "video");
    mediaPlayer.setVideoOutput(videoWidget);
    mediaPlayer.setMedia(QUrl("link"));
    mediaPlayer.play();@

    Can someone help? Thanks!

    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