QGIS API Documentation 3.39.0-Master (bca3cdb6021)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
QgsMediaWidget Class Reference

The QgsMediaWidget class creates a widget for playing back audio and video media files. More...

#include <qgsmediawidget.h>

Inheritance diagram for QgsMediaWidget:
Inheritance graph
[legend]

Public Types

enum  Mode { Audio , Video }
 The mode determines the user interface elements visible within the widget. More...
 

Public Member Functions

 QgsMediaWidget (QWidget *parent=nullptr)
 Constructor.
 
QString mediaPath () const
 Returns the media path.
 
QMediaPlayer * mediaPlayer ()
 Returns the QMediaPlayer object.
 
Mode mode () const
 Returns the media widget mode.
 
void setMediaPath (const QString &path)
 Sets the media path.
 
void setMode (Mode mode)
 Sets the media widget mode.
 
void setVideoHeight (int height)
 Sets the video frame height.
 
int videoHeight () const
 Returns the video frame height.
 

Detailed Description

The QgsMediaWidget class creates a widget for playing back audio and video media files.

Since
QGIS 3.30

Definition at line 37 of file qgsmediawidget.h.

Member Enumeration Documentation

◆ Mode

The mode determines the user interface elements visible within the widget.

Enumerator
Audio 

Audio-centric user interface.

Video 

Video-centric user interface.

Definition at line 47 of file qgsmediawidget.h.

Constructor & Destructor Documentation

◆ QgsMediaWidget()

QgsMediaWidget::QgsMediaWidget ( QWidget *  parent = nullptr)
explicit

Constructor.

Definition at line 28 of file qgsmediawidget.cpp.

Member Function Documentation

◆ mediaPath()

QString QgsMediaWidget::mediaPath ( ) const
inline

Returns the media path.

Definition at line 60 of file qgsmediawidget.h.

◆ mediaPlayer()

QMediaPlayer * QgsMediaWidget::mediaPlayer ( )
inline

Returns the QMediaPlayer object.

Definition at line 92 of file qgsmediawidget.h.

◆ mode()

Mode QgsMediaWidget::mode ( ) const
inline

Returns the media widget mode.

Definition at line 70 of file qgsmediawidget.h.

◆ setMediaPath()

void QgsMediaWidget::setMediaPath ( const QString &  path)

Sets the media path.

Definition at line 100 of file qgsmediawidget.cpp.

◆ setMode()

void QgsMediaWidget::setMode ( Mode  mode)

Sets the media widget mode.

Definition at line 113 of file qgsmediawidget.cpp.

◆ setVideoHeight()

void QgsMediaWidget::setVideoHeight ( int  height)

Sets the video frame height.

Note
setting the height to 0 is interpreted as a video frame that will expand to fill available height in the widget's parent layout.

Definition at line 127 of file qgsmediawidget.cpp.

◆ videoHeight()

int QgsMediaWidget::videoHeight ( ) const

Returns the video frame height.

Definition at line 122 of file qgsmediawidget.cpp.


The documentation for this class was generated from the following files: