Linked png in QtHelp file
-
Hi and welcome to devnet,
You have to be more specific, which version of Qt 5 are you talking about ?
-
Your current version of QtHelp is likely using QtWebKit as backend which as been deprecated and was removed in Qt 5.6. More recent version is using the basic QTextBrowser class which has less features.
You can test with Qt 5.5.X
-
Update : sorry missed SGaist post. This info is redundant :)
Yes but I think it was also changed.
Let me find old 5.5 and check :)
Maybe i remember wrong.Nope. was webkit before
So it might be related going from webkit to Text Browser?
-
Let me see if I understand where this is going. Are you saying that the move to QTextBrowser is what broke the ability to handle HTML in all the ways a browser would? That would include handling "<a href='...png'....". So, I'd have to revert from 5.6 back to 5.5; or wait for a fix to QTextBrowser?
-
@gegorbet
Hi, im not saying its that. You should test it.Its just that TextBrowser is not a full browser as webkit was. (AT ALL)
If using the TextBrowser is the reason for it then you should
look into find other way to make it work for Text Browser. ( other html code)
Or just use 5.5 if that is an option.
Webkit is deprecated and unless TextBrowser is supposed to handle png the same way,
its very unlikely there will ever be a fix. -
@mrjj Good to know. I am building 5.5.1 to see if webkit fixes my problem. If so and if - as you say - there is unlikely to be a fix forthcoming in QTextBrowser; then at least I'll know the situation. I would be inclined to wrap all my linked PNG files in thin HTML rather than be tied to a deprecated class.
-
I'll have to back off my previous statement. The 5.5.1 I built has an Assistant binary which - according to the About - uses TextBrowser. So, I have not demonstrated that WebKit won't display png's correctly. What arguments do I add to the configure to insure Assistant builds with WebKit?
How do I attach an image to a post?
-
What OS are you on ?
-
After a long set of sessions building Qt 5.5.1 with arguments I thought might link in WebKit, I arrived at a 5.5.1 assistant which its About dialog says still uses TextBrowser. Lots of Googling with no results, so I ask here: do you know what arguments to ./configure insure Assistant uses WebKit?
-
What parameters are you passing to configure when you build Qt ?
-
@mrjj My efforts to prove that the WebKit-to-TextBrowser change is what has removed the ability to directly anchor PNG files in Assistant-based help has just taken too long and not produced reliable results. Similarly, my efforts to get acknowledgement (here or in various Googled sites) that this is a known problem have been fruitless thus far.
I wrote a script that produces a thin HTML wrapper to each PNG I wish to anchor. Writing that script, applying it tor 17 anchored image files and modifying the appropriate href= values in 28 individual HTML components took much less time than I'd spent so far trying to find a Qt fix or appropriate general modification in our code.
Thank you, mrjj, for the knowledge about TextBrowser. I will likely be marking this topic as "Solved" shortly unless there are any further relevant insights brought forward.
-
Thank you for trying to verify. I had no luck either finding info regarding loss of
this feature or similar. I remembered it - as suddenly the help looked .. different.Could you for future reference paste a "used to work" html sample and
how it should look to do the correct thing with text browser? -
@mrjj
This used to work:
<a href=“images/vhw_enh_groups.png”>vHW Enhanced Groups</a>
Now I must use:
<a href=“vhw_enh_groups.img.html”>vHW Enhanced Groups</a>
where the *.img.html file is just a rudimentary header and footer of HTML around:
<img src="images/vhw_enh_groups.png" alt="van Holde -Weischet groups dialog"/> -
I tried one more time to build a 5.5.1 Qt where Assistant (for custom help) uses WebKit. I added "-D BROWSER_QTWEBKIT" as a configure argument. But I encountered numerous compile and link problems and never got a new Assistant built.
So, I've decided to spend no more time on this. The topic is "Solved" in the sense that it is assumed that TextBrowser will never properly handle anchored png files. In our applications help files, all anchored png have been replaced with img.html files that are thin HTML wrappers around an embedded image.
Thanks again. mrjj, for your help.