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] QMediaPlaylist not found in qt5 cmake projet
Forum Updated to NodeBB v4.3 + New Features

[Solved] QMediaPlaylist not found in qt5 cmake projet

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 7.9k 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.
  • H Offline
    H Offline
    hisoft
    wrote on last edited by
    #1

    Hi,

    I'm trying to integrate QtMultimedia to my qt5 projet (structured with cmake 2.8). When i run the build, i get the following error :
    @fatal error: QtMultimedia/QMediaPlaylist : No such file or directory@

    In the CMakeLists.txt i added the following line (but i doesn't solved the problem) :
    @SET(QT_USE_QTMULTIMEDIA TRUE)@

    Here is my code :
    @
    #include <QtMultimedia/QMediaPlaylist>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);

    QMediaPlaylist * playlist = new QMediaPlaylist;
    playlist->addMedia(QUrl("/home/user/Video-Sans titre-0.mpeg"));
    playlist->setCurrentIndex(1);
    
    QMediaPlayer * player = new QMediaPlayer;
    player->setPlaylist(playlist);
    
    QVideoWidget * videoWidget = new QVideoWidget;
    player->setVideoOutput(videoWidget);
    videoWidget->show();
    
    player->play();
    
    return a.exec(&#41;;
    

    }
    @

    Thanks.

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

      Hi,

      I have not used cmake with Qt 5 yet, but following the logic of qmake, don't you have something like QT_USE_QTMULTIMEDIAWIDGETS ?

      Hope it helps

      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
      • H Offline
        H Offline
        hisoft
        wrote on last edited by
        #3

        I didn't have it. But even if i do it the error still remain.

        Thanks for your reply.

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

          "This":http://www.kdab.com/using-cmake-with-qt-5/ might help you

          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
          • H Offline
            H Offline
            hisoft
            wrote on last edited by
            #5

            I've already read this link (thanks). I've solved the problem by adding the following lines (into the CMakeLists.txt) :

            @
            ...
            FIND_PACKAGE( Qt5Multimedia REQUIRED )
            FIND_PACKAGE( Qt5MultimediaWidgets REQUIRED )
            ...
            SET(QT_USE_QTMULTIMEDIA TRUE)
            SET(QT_USE_QTMULTIMEDIAWIDGETS TRUE)
            ...
            QT5_USE_MODULES (${EXECUTABLE_NAME} Multimedia MultimediaWidgets)
            ...
            @

            Thanks.

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

              You're welcome !

              Now that it's building, please also update the thread title prepending [solved] so other forum users may know a solution has been found :)

              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