Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] cannot include QVideoWidget
Forum Updated to NodeBB v4.3 + New Features

[Solved] cannot include QVideoWidget

Scheduled Pinned Locked Moved General and Desktop
10 Posts 3 Posters 12.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Timmoth
    wrote on last edited by
    #1

    hi all, i keep getting the error:
    C1083: Cannot open include file: 'QVideoWidget': No such file or directory

    forgive me if the answer is obvious - i am new to Qt.

    Regards, Tim.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you add

      @QT += multimedia@

      in your pro file ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Timmoth
        wrote on last edited by
        #3

        yes, i have it all on one line though - i dont suppose that makes a difference ?
        @QT += core gui multimedia@

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Qt 5 ?

          Then you might be missing

          @QT += widgets@

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • T Offline
            T Offline
            Timmoth
            wrote on last edited by
            #5

            well i do have that in :
            @
            QT += core gui multimedia
            greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

            SOURCES +=
            main.cpp

            HEADERS +=

            @

            (Thats my entire .pro file)

            1 Reply Last reply
            0
            • T Offline
              T Offline
              tomma
              wrote on last edited by
              #6

              QVideoWidget is found in QtMultimediaWidgets:
              @QT += multimediawidgets@

              1 Reply Last reply
              1
              • T Offline
                T Offline
                Timmoth
                wrote on last edited by
                #7

                my pro file now looks like this :
                @
                QT += core gui
                QT += multimediawidgets
                QT += multimedia
                greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

                SOURCES +=
                main.cpp

                HEADERS +=
                @
                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();
                

                }

                @

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Did you re-run qmake once you made the modifications to your pro file ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    Timmoth
                    wrote on last edited by
                    #9

                    facepalm
                    sorry for wasting your time - i am very new to Qt.

                    Regards, Tim.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      No worries, this happen all the time even to experienced users

                      Happy coding !

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved