[Solved] cannot include QVideoWidget
-
hi all, i keep getting the error:
C1083: Cannot open include file: 'QVideoWidget': No such file or directoryforgive me if the answer is obvious - i am new to Qt.
Regards, Tim.
-
-
yes, i have it all on one line though - i dont suppose that makes a difference ?
@QT += core gui multimedia@ -
-
well i do have that in :
@
QT += core gui multimedia
greaterThan(QT_MAJOR_VERSION, 4): QT += widgetsSOURCES +=
main.cppHEADERS +=
@
(Thats my entire .pro file)
-
QVideoWidget is found in QtMultimediaWidgets:
@QT += multimediawidgets@ -
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 ?
-
facepalm
sorry for wasting your time - i am very new to Qt.Regards, Tim.
-
No worries, this happen all the time even to experienced users
Happy coding !