Results 1 to 4 of 4

Thread: Qt 5: handling of CSS imports in QtHelp

  1. #1
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Qt 5: handling of CSS imports in QtHelp

    Note: this is a reposting of my original post in the Qt Programming sub-forum. I wasn't aware of this WebKit sub-forum...

    ---------------------------------------

    Hi,

    I use QtHelp for my application’s help. It’s all very simple HTML and CSS code. In my help’s home page, I link a CSS file as follows:

    Qt Code: Switch view

    Qt Code:
    1. <link href="res/stylesheet.css" rel="stylesheet" type="text/css"/>
    To copy to clipboard, switch view to plain text mode 
    To copy to clipboard, switch view to plain text mode

    Then, in my res/stylesheet.css file, I import another CSS file as follows:

    Qt Code: Switch view

    Qt Code:
    1. @import "/doc/res/common.css";
    To copy to clipboard, switch view to plain text mode 
    To copy to clipboard, switch view to plain text mode

    /doc is the root folder for my application’s help and it’s how QtHelp (in Qt 4.8) used to require the import to be done (see this previous thread of mine).

    However, now, the above @import statement just doesn’t work, meaning that my application’s help doesn’t get styled anymore.

    So, was I doing the right thing before and/or have things changed in Qt 5? What is certain is that if I include my CSS code directly in res/stylesheet.css, then everything is fine, telling me that the issue is with @import…

    Anyway, any help would be much appreciated…

    Cheers, Alan.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt 5: handling of CSS imports in QtHelp

    I was rather thinking about a forum at webkit.org when I suggested posting at a webkit forum
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 5: handling of CSS imports in QtHelp

    I must confess that it did cross my mind... This being said, I was wondering whether the problem wasn't, somehow, related to Qt 5 rather than WebKit itself. Still, I am also going to check on the WebKit forum...

  4. #4
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 5: handling of CSS imports in QtHelp

    FWIW, I just came back to the above issue and found out what happened. Basically, the syntax changed (?) between Qt 4 and Qt 5. So, rather than having something like:

    Qt Code:
    1. @import "/doc/res/common.css";
    To copy to clipboard, switch view to plain text mode 
    We should now have:

    Qt Code:
    1. @import "qthelp://namespace/virtualFolder/doc/res/common.css";
    To copy to clipboard, switch view to plain text mode 
    Now, I wish it had been documented somewhere...

Similar Threads

  1. Qt 5: handling of CSS imports in QtHelp
    By agarny in forum Qt Programming
    Replies: 4
    Last Post: 21st January 2013, 17:49
  2. Problem with SDK 1.2 (Qt 4.8) and QtHelp
    By agarny in forum Qt Programming
    Replies: 3
    Last Post: 3rd February 2012, 16:24
  3. Replies: 3
    Last Post: 22nd October 2010, 20:49
  4. qtHelp namespaces
    By winkle99 in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2010, 01:32
  5. QtHelp
    By WinchellChung in forum General Discussion
    Replies: 5
    Last Post: 14th May 2008, 23:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.