How to make QWebView load external JPG resources? - qt

QWebView for some weird reason doesn't want to load JPG images. How do I fix it?

try this options
/*QWebView * view*/
view->page()->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls,true);
view->page()->settings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls,true);
view->page()->settings()->setAttribute(QWebSettings::LocalStorageEnabled,true);
view->page()->settings()->setAttribute(QWebSettings::AutoLoadImages,true);
this may help

Related

File Path in WordPress not as default

I have an issue with wordpress image file paths.
Have no idea how this happened but all images are blank on media gallery, and after a lot of trying different things to fix have realised that the image filepath is showing
https:///wp-content/
as opposed to
https://example.com/wp-content/
Have tried search and replace which I thought would fix, but hasnt worked...any ideas much appreciated!!!
You can try to install the AJAX Thumbnail Rebuild plugin to the get all images in Media Gallery tab.
Thanks!!

Cascades: ImageView with external source

I need load an ImageView with a external source (http://www.example.com/some_image.jpg).
I tried with a ImageTracker, but doesn't work
Anyway, Thanks!
This isn't supported yet - https://developer.blackberry.com/cascades/download/roadmap/
As a workaround you can save the image to a file and load it from there.
I recommed to show the image in a WebView
Best of luck

I need to force a refresh of custom.css in the Thesis Framework

Does anyone know the best way to refresh custom.css in Thesis? I'm running into a problem where some of my css isn't getting implemented due to browser caching of custom.css. I tried adding a variable to the filename like "custom.css?v=1" and while this works, it gives me an error every time I load the page. Any help would be appreciated. Thanks in advance.
You can disable CSS caching by adding this filter to the custom_functions.php file.
function cache_customcss()
{
return true;
}
add_filter('thesis_cache_query','cache_customcss');

Can't view image from webroot in CakePHP

I am trying to display an image from the /webroot/img/ folder using the following CSS syntax: .template-mainbg{background:#B8D9EA url('../img/bg_top.png') repeat-x left top;}
The image never loads and if I try http://site.com/img/bg_top.png it gives me a Missing Img controller error.
This very wierd since the default Cake icon loads perfectly. Both from CSS and direct link.
What could be the problem?
Thank you!
EDIT I solved this problem. Unfortunately I spent 2 hours to figure out that Dreamweaver didn't sync the image with the remote server. Thank you anyway for all your help!
paths are relative to the CSS document, so it depends where the CSS file is being served from.
In the above example, ../img/bg_top.png your CSS file would need to be in the site root I believe.
The image never loads and if I try http://site.com/img/bg_top.png it gives me a Missing Img controller error.
my understanding is that you can't access anything from "above" the webroot from a browser, hence the message.

How to tell QWebPage not to load images?

I'm using QWebPage to load needed site page. But QWebPage loading all additional resources: images, csses, and so on.
Is there any way to present this behavior and cancel loading of images?
Only idea that I have - to write custom QNetworkConnectionManager, which will return some dummy picture instead of requested. But this looks a bit of complicated.
You want to turn off the AutoLoadImages:
http://doc.trolltech.com/4.4/qwebsettings.html
Using the QWebSettings::AutoLoadImages attribute.

Resources