Skip to content

Commit

Permalink
Changed VideoOutput to be from centerwidget to its own widget.
Browse files Browse the repository at this point in the history
Added Playlist placeholder.
  • Loading branch information
Dimi1010 committed Apr 22, 2020
1 parent cb1a0db commit e460d30
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
4 changes: 1 addition & 3 deletions MediaPlayer/MediaPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ MediaPlayer::MediaPlayer(QWidget *parent)
ui.setupUi(this);

player = new QMediaPlayer(this);
video = new QVideoWidget(this);
player->setVideoOutput(video);
this->setCentralWidget(video);
player->setVideoOutput(ui.videoWidget);

playlist = new QMediaPlaylist(this);
player->setPlaylist(playlist);
Expand Down
2 changes: 0 additions & 2 deletions MediaPlayer/MediaPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <QtWidgets/QMainWindow>
#include <QMediaPlaylist>
#include <QMediaPlayer>
#include <QVideoWidget>
#include <QSlider>
#include <QLabel>

Expand Down Expand Up @@ -52,7 +51,6 @@ private slots:
FileMetadataDetails* fileDetails;

QMediaPlayer* player;
QVideoWidget* video;
QMediaPlaylist* playlist;
QSlider* vol_slider;
QSlider* pos_slider;
Expand Down
30 changes: 29 additions & 1 deletion MediaPlayer/MediaPlayer.ui
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,27 @@
<property name="windowTitle">
<string>MediaPlayer</string>
</property>
<widget class="QWidget" name="centralWidget"/>
<property name="documentMode">
<bool>false</bool>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QListWidget" name="listWidget">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QVideoWidget" name="videoWidget" native="true">
<property name="autoFillBackground">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
Expand Down Expand Up @@ -232,6 +252,14 @@
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>QVideoWidget</class>
<extends>QWidget</extends>
<header>QVideoWidget</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="MediaPlayer.qrc"/>
</resources>
Expand Down
4 changes: 4 additions & 0 deletions MediaPlayer/MediaPlayer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@
<OutputFile>$(OutDir)\$(ProjectName).exe</OutputFile>
<GenerateDebugInformation>false</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="FileMetadataDetails.cpp" />
Expand Down

0 comments on commit e460d30

Please sign in to comment.