qt4 - QWebview - setBaseUrl doesn't work -


i want render html qstring in qwebview using

qwebview::sethtml( qstring, qurl ); 

the images should loaded temporary directory c:/temp. in html code images referred file-names, without path e.g.

<img src="myimage.png"> 

i provide path baseurl 2nd parameter of sethtml, images not rendered. i've tried refer images full path:

<img src="c:/temp/myimage.png"> 

and works correctly - image displayed.

i've checked, whether url valid:

qurl base = qurl::fromuserinput("c:/temp");     if (!base.isvalid())         return false; 

and url reported valid. doing wrong here?

i'm working on windows, qt 4.8.4

thanks hints!

solved! right click on missing image symbol in qwebview reviled, image had not address c:/temp/myimage.png expected c:/myimage.png. i've tried set baseurl c:/temp/. , works!

looks qwebview interpreted baseurl html-file, relative images located. in point of view doesn't make sense qwebview::sethtml source comes string, , there no html-file, base-directory.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -