简体   繁体   中英

Qt Webkit : Not allowed to load local resource

Greeting

When i try to load picture from local drive i get the following error !!!

Not allowed to load local resource: file:///c:/qt/4.8.5/examples/webkit/imageanalyzer/resources/images/mtRainier.jpg

This is how i try to load image in HTML.

<img id="ImageObject" src="file:///c:/qt/4.8.5/examples/webkit/imageanalyzer/resources/images/mtRainier.jpg" alt="" width="304" height="228">

How can i fix this ?

Im using QT 4.8.5 , Qt Webkit And Visual Studio 2008 .

Thanks in Advance

I found the problem !!! JPEG was not supported in my qt. The error is totally irrelevant. Add JPEG support to your project and you're good!

PS: If you have same problem and you want to know this solution will help you or not, Try following code and see supported formats, If JPEG is not among them, Then you have same problem otherwise this solution wont work for you!

qDebug() << QImageWriter::supportedImageFormats();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM