Hi!
I am trying QT 4.4 tecnology preview for webkit to have full html functionality in my application. It does not display images!! Any help why?
Regards,
Manoj
Hi!
I am trying QT 4.4 tecnology preview for webkit to have full html functionality in my application. It does not display images!! Any help why?
Regards,
Manoj
I'm sorry that I don't have an answer for you, but maybe it doesn't work, because it still is a technology preview ?
but why is it so that it shows the images in online page but not offline? i.e. If I show the page "http://www.yahoo.com" it shows perfectly but if I save the same page in html format along with its all images, it shows everything except images???
I am stuck here with this!! please help!!
How do the links look like? What is current working directory?
J-P Nurmi
Current working directory is the directory where I am executing my project from! There are very funny things happening:
(1) It shows the online page perfectly.
(2) It does not show the offline images.
(3) It shows the images from some server in offline pages but that too only when I load the page with setHtml() function, not with load() function!!
How do I get it done??
Could you answer the questions, please?
- What does
output?Qt Code:
To copy to clipboard, switch view to plain text mode- In saved HTML page, what do missing images have as img-elements src attribute?
<img src="..."/>
J-P Nurmi
Hi!
The current Path returns:
C:/HTMLViewer
The image source is:
"img1.jpg"
I am passing html/test.htm as path for url and img1.jpg is stored in html folder.
BTW: Image is displayed if I give the src as: ftp::///C:/HTMLViewer/html/img1.jpg but I don't want to specify absolute paths here.
Did you compile Qt with .jpg support?
Qt 5.3 Opensource & Creator 3.1.2
So it was about current working directory after all. src="image.png" means that the image is searched from the current directory. I don't know if there is a possibility to set search paths or something, but presumably the images are shown once you launch the application from C:\HTMLViewer\html or you change it to src="html/image.png".
J-P Nurmi
J-P Nurmi
Well, I think I tried to write in detail but may be you can tell me what details are you expecting?
I have already stated that:
(1) It shows the online page perfectly.
(2) It does not show the offline images.
(3) It shows the images from some server in offline pages but that too only when I load the page with setHtml() function, not with load() function!!
(4) It also show the images from disk if I give them as: <img src=FTP:///C:/HTMLViewer/html/img1.jpg">
Start with enabling console so you can see the debug output, which might provide useful information.
Notice, that there is a significant difference when index.html contains src="image.png" and you do:
and launch the app in C:/HTMLViewer/Qt Code:
viewer->setHtml("html/index.html");To copy to clipboard, switch view to plain text mode
versus when you doC:/HTMLViewer/> app.exe
and launch the app in C:/HTMLViewer/htmlQt Code:
viewer->setHtml("index.html");To copy to clipboard, switch view to plain text mode
Now that I take a look at QWebView docs, it seems that setHtml() takes an optional baseUrl parameter. Did you pass anything as baseUrl? All the relative paths are clearly relative to this baseUrl.C:/HTMLViewer/html> ..\app.exe
J-P Nurmi
kerchen (6th May 2009)
Hi!
Thank you for telling me the benifits of console view. I started the same but did not get any information regarding paths in html file in fact, I did not get any information on the console view on loading the page itself.
I tried running the application both the ways, you describe but no luck.
I also tried to add the baseURL in setHtml function and that also did not produce any results. BTW, baseURL is only available in setHtml() function and that is not usable if I want to load a html page from some url. I will have to use load() method for this purpose.
I beg the help of some trolltech guys here. I am really stuck at this!! I don't believe that a tool like webkit is not able to show up images from local disk.
What about <img src="file:///html/img1.jpg">?
J-P Nurmi
we have to provide the whole absolute file path along with file protocol i.e.
file:///c:/HTMLViewer/html/img1.jpg
I am eagerly waiting for some of trolltech guys to answer this! Am I making some mistake here or it is a bug to be fixed?? Can I rely on the final release and wait for the same?
Bookmarks