[SOLVED] QFSFileEngine::open: No file name specified
-
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??? -
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
-
Error has gone, but it still does not save playlist...
@playlist->save(QUrl::fromLocalFile("C:/Users/Admin/Desktop/Test/test.m3u";);@
-
Did you check whether save returns true or false ? And what error you can retrieve ?
-
Hey, how can I check that??? I don't get any error...
-
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 ?
-
@"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 -
What happens if you use:
@ playlist->save(QUrl::fromLocalFile("C:/Users/Admin/Desktop/Test/test.m3u"), "m3u");@ ?
-
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???
-
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
-
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;}
}@
4/11