[Solved] cannot include QVideoWidget
-
my pro file now looks like this :
@
QT += core gui
QT += multimediawidgets
QT += multimedia
greaterThan(QT_MAJOR_VERSION, 4): QT += widgetsSOURCES +=
main.cppHEADERS +=
@
yet the error is still occurring -
for reference my source code is :
@
#include <QApplication>
#include <QtCore>
#include <QWidget>
#include <QtMultimedia>
#include <QMediaPlayer>
#include <QVideoWidget>int main(int argc, char *argv[])
{
QApplication app(argc, argv);QMediaPlayer * player = new QMediaPlayer; QMediaPlaylist* playlist = new QMediaPlaylist(player); playlist->addMedia(QUrl("C:/Users/Public/Videos/Sample Videos/Wildlife.wmv")); QVideoWidget* videoWidget = new QVideoWidget; player->setVideoOutput(videoWidget); videoWidget->show(); playlist->setCurrentIndex(1); player->play(); return app.exec();
}
@
-
Did you re-run qmake once you made the modifications to your pro file ?
-
No worries, this happen all the time even to experienced users
Happy coding !