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] QFSFileEngine::open: No file name specified
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QFSFileEngine::open: No file name specified

Scheduled Pinned Locked Moved General and Desktop
11 Posts 2 Posters 14.1k Views
  • 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi,

    You didn't set the protocol when creating your QUrl object.

    You should rather use "fromLocalFile":http://qt-project.org/doc/qt-5/qurl.html#fromLocalFile

    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
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #3

      Error has gone, but it still does not save playlist...

      @playlist->save(QUrl::fromLocalFile("C:/Users/Admin/Desktop/Test/test.m3u";);@

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

        Did you check whether save returns true or false ? And what error you can retrieve ?

        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
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #5

          Hey, how can I check that??? I don't get any error...

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

            QPlayList::save() returns a boolean value to tell you if it succeeded or not

            QMediaPlayList::errorString() returns a string corresponding to the current error.

            Did you use both ?

            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
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #7

              @"Playlist format is not supported." @

              I read documentation and nowhere says what format is supported...

              @ playlist->save(QUrl::fromLocalFile("C:/Users/Admin/Desktop/Test/test.m3u"),);@

              Tried with all of them and none is working... Unless I am doing something wrong... It does create file test.m3u but then prints error "Playlist format is not supported"...
              Multimedia playlist .m3u
              Multimedia playlist with Unicode support .m3u8
              Windows Media Player .wpl

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

                What happens if you use:

                @ playlist->save(QUrl::fromLocalFile("C:/Users/Admin/Desktop/Test/test.m3u"), "m3u");@ ?

                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
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #9

                  aww... It works :) ... I tried with "*.m3u", ".m3u" but never just "m3u"... Thanks

                  Another question, when I am loading playlist, how can I display file names in qlistwidget???

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

                    You can use a for loop and get each QMediaContent from the playlist. With that you should be able to get the file path and then the name

                    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
                    • ? Offline
                      ? Offline
                      A Former User
                      wrote on last edited by
                      #11

                      Awww works :) Thank you...

                      @void MainWindow::on_pushButton_7_clicked()
                      {
                      playlist->load(QUrl::fromLocalFile("C:/Users/Admin/Desktop/Test/playlist.m3u"), "m3u");
                      int count = playlist->mediaCount();
                      for(int i = 0; i < count; i++){
                      QString test = playlist->media(i).canonicalUrl().fileName();
                      qDebug() << test;}
                      }@

                      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