Creating FileRef object from QString

Plasty Grove plasty.grove at gmail.com
Sat Dec 5 19:59:35 CET 2009


Hi,

I'm developing using qt and have a situation where I have to create a
FileRef object from a QString object.

--------------------------------------------------
TagLib::FileRef tagFile("/home/mydir/music/song.mp3") //---> Works fine
--------------------------------------------------
QString qstr = "/home/mydir/music/song.mp3";
const char* str = qstr.toLocal8Bit().constData();
TagLib::FileRef tagFile(str); //---> Doesn't work, shows as empty in
debugger and segfaults when I try to access
--------------------------------------------------

What am I doing wrong here?

Thanks,
Plasty.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/taglib-devel/attachments/20091206/452d630f/attachment.htm 


More information about the taglib-devel mailing list