How to access data file form "assets" dir?

Xiaognag Wang xiaogangwang2012 at hotmail.com
Mon Feb 4 09:39:52 UTC 2013


Hello everyone:
I access data file with bellow method:       QString layname= "assets:/test.mif";
    QFile file(layname);
    QDir dir;
    qDebug() << "ABSfilepath = " << dir.absoluteFilePath(file.fileName());
    if (file.exists())
    {
        qDebug() << "file exists.";
        qDebug() << "open = " << file.open(QFile::ReadOnly);
        qDebug() << "data = " << file.readAll();    }In this way, program prints "file exists".
but when I access this file with MITAB interface :    handle = mitab_c_open(layname.toAscii().data());    if(handle!=0)    {        qDebug()<<"open lay success";    }    else    {        qDebug()<<"open lay fail";        qDebug() <<  "Error = " <<  mitab_c_getlasterrormsg();        return;    }mitab_c_open() still return failed. when I access file like bellow:    mitab_c_open("/data/tmp/test.mif")it will return success.
I think this different is caused by file path, but I am not sure.Does anyone has experience with this? Could you please give me a suggestion?
Thanks in advancd.Eric2013.2.4 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/necessitas-devel/attachments/20130204/7eeebd38/attachment.html>


More information about the Necessitas-devel mailing list