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 Update on Monday, May 27th 2025

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

Scheduled Pinned Locked Moved General and Desktop
11 Posts 2 Posters 14.0k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on 18 Jan 2014, 11:36 last edited by
    #1

    Hello, I am trying to save Playlist, but keep getting error "QFSFileEngine::open: No file name specified"

    @void MainWindow::on_pushButton_6_clicked()
    {
    playlist->save(QUrl("C:/Users/Admin/Desktop/Test"));
    }@

    also tried:
    @playlist->save(QUrl("C:/Users/Admin/Desktop/Test/test.txt"));@

    I am trying to find to which formats QMediaList can be saved, but without success...

    @bool QMediaPlaylist::save(const QUrl & location, const char * format = 0)@
    Can someone give me an example of how to correctly use that format???

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 18 Jan 2014, 22:06 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 19 Jan 2014, 13:59 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
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 19 Jan 2014, 22:00 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 20 Jan 2014, 06:15 last edited by
            #5

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

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 20 Jan 2014, 08:50 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 20 Jan 2014, 15:09 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
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 20 Jan 2014, 20:15 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 20 Jan 2014, 20:58 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
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 21 Jan 2014, 20:38 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 21 Jan 2014, 21:34 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

                        1/11

                        18 Jan 2014, 11:36

                        • Login

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