Designing a user interface for video players

The next example is that of the video player. Since QMediaPlayer also supports video output, we can use the same user interface and C++ code from the previous audio player example, and just make some minor changes to it.

  1. First, open project file (.pro) and add in another keyword, called multimediawidgets:
QT += core gui multimedia multimediawidgets 
  1. Then, open up mainwindow.ui and add a Horizontal Layout (name it as movieLayout) above the timeline slider. After that, right-click on the layout and select Morph into | QFrame. We then set its sizePolicy property to Expanding, Expanding:
  1. After ...

Get Hands-On GUI Programming with C++ and Qt5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.