Hi
I installed Qt5 and since Phonon is not supported in Qt5 I'm forced to use something else, so I decided to use QtMultimedia.
.pro file:
QT += core gui
CONFIG += mobility
MOBILITY += multimedia
QT += core gui
CONFIG += mobility
MOBILITY += multimedia
To copy to clipboard, switch view to plain text mode
.cpp code:
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QtGui>
#include <QtCore>
#include <QtMultimedia/QMediaPlayer>
...
void MainWindow::on_pushButton_clicked()
{
QMediaPlayer *player = new QMediaPlayer(this);
player->setVolume(50);
player
->setMedia
(QUrl::fromLocalFile("some_path"));
player->play();
}
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QtGui>
#include <QtCore>
#include <QtMultimedia/QMediaPlayer>
...
void MainWindow::on_pushButton_clicked()
{
QMediaPlayer *player = new QMediaPlayer(this);
player->setVolume(50);
player->setMedia(QUrl::fromLocalFile("some_path"));
player->play();
}
To copy to clipboard, switch view to plain text mode
But I'm getting following errors:
df5cb69d80eadef8a7a0ce6b0ec6cc04.jpg
How can I solve this. Thank you
Bookmarks