path: root/examples/multimediawidgets
diff options
authorJames McDonnell <>2017-03-23 15:36:51 -0400
committerJames McDonnell <>2017-03-28 14:26:09 +0000
commit684456d8fbdb80d621e3c4838544c2878e3f2a43 (patch)
tree794b73f6251764aa7952041e45a74e258b41166b /examples/multimediawidgets
parent883df8dfda760fdbe850303383ba098887abbf62 (diff)
Implement QAudioRoleControl for QNX
The system must provide a JSON file that maps Qt audio roles to the system's audio types. This is necessary because QNX doesn't dictate the audio types that a system must use. Anyone creating a QNX system is free to define whatever audio types they deem to be appropriate for that system. Set the audio role for the Qt player example to VideoRole and added code to dump the supported audio roles. Change-Id: I34d2c5da0033f69b9dd476a0eadccf3d87d07bfd Reviewed-by: Yoann Lopes <>
Diffstat (limited to 'examples/multimediawidgets')
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/multimediawidgets/player/player.cpp b/examples/multimediawidgets/player/player.cpp
index 8f291c501..085dff6a7 100644
--- a/examples/multimediawidgets/player/player.cpp
+++ b/examples/multimediawidgets/player/player.cpp
@@ -60,6 +60,10 @@ Player::Player(QWidget *parent)
//! [create-objs]
player = new QMediaPlayer(this);
+ player->setAudioRole(QAudio::VideoRole);
+ qInfo() << "Supported audio roles:";
+ for (QAudio::Role role : player->supportedAudioRoles())
+ qInfo() << " " << role;
// owned by PlaylistModel
playlist = new QMediaPlaylist();