PDA

View Full Version : Problem with SDK 1.2 (Qt 4.8) and QtHelp



agarny
2nd February 2012, 17:32
Hi,

I was wondering whether someone had upgraded to SDK 1.2 (i.e. Qt 4.8.0) and uses QtHelp (together with QtWebKit and sqlite) for their software's help?

My project's help used to work fine with Qt 4.7.4, but though the help still shows up on Windows using Qt 4.8.0, it uses a different font (!!). Then, the help just doesn't show up on neither both Linux nor Mac OS X.

I checked the .qch file in Qt Assistant and it's fine on all three platforms, so I am not quite sure what's going wrong here. Any idea? Could it be a conflict of Qt versions?

Cheers, Alan.

PS: I also noticed that on Linux, QtWebKit has a version of 4.9.0 rather than 4.8.0 as is the case for the other Qt libraries, meaning that I had to customise my packaging script for QtWebKit...!

agarny
3rd February 2012, 12:35
Ok, after some further tests, the culprit is QtWebKit. If I replace the 4.9.0 version of QtWebKit with the 4.7.4 version, then my application works exactly as expected on both Windows and Linux. I can't tell for Mac OS X, since things work a bit differently with the bundle and I can't be bothered to faff around just to test QtWebKit on that platform.

Now, I can't imagine that this issue hasn't been observed before, so...?!

MarekR22
3rd February 2012, 12:46
File a bug report.
I far as I know changes in Qt 4.8 are quite extensive so definitely they could broke something.
For details see here (http://labs.qt.nokia.com/2011/12/15/qt-4-8-0-released/).

agarny
3rd February 2012, 15:24
Ok, I have got it! I used to have a CSS file which included another CSS file:


@import url("../../res/common.css");
It used to work fine with the version of QtWebKit in Qt 4.7.4, but not with the one in Qt 4.8.0. It would seem that QtWebKit doesn’t like the use of relative paths in CSS import files anymore (?). So, instead, I had to use:


@import url("/doc/res/common.css");
with doc being the virtual folder in my Qt help file. Otherwise, I want to be able to use my CSS file both within a web page and a Qt help page, so I now have:


@import url("../../res/common.css");
@import url("/doc/res/common.css");
With the first import being required to get things to work on a web page and the second import on a Qt help page. I really wish I didn't have to do that, but...