Assistant html style issue



  • Hi,

    (First time poster, used Qt4 a lot but never Qt5.)

    I use the Qt 4.8.5 Assistant to display my help. I'm trying to update to the Qt 5.7.0 Assistant.

    My docs are written in html and include a lot of my own styling. e.g.

    <html>
    <style type="text/css" media="screen">
    h1 {
      margin:0 0 0.6em  0;
      line-height: 1.2em;
      max-width: 900px;
      font-weight: bold;
      font-size: 2em;
      letter-spacing: 1px;
    }
    ...
    </style>
    ...
    

    This all worked fine in the Qt 4.8.5 Assistant, but seems to get ignored in the Qt 5.7.0 Assistant. Is that expected?

    A quick look at the source suggests that the older Assistant subclasses QWebView by default:

    #if !defined(QT_NO_WEBKIT)
    class HelpViewer : public QWebView
    #else
    class HelpViewer : public QTextBrowser
    #endif
    

    The newer Assistant subclasses QTextBrowser by default:

    #if defined(BROWSER_QTWEBKIT)
    class HelpViewer : public QWebView
    #elif defined(BROWSER_QTEXTBROWSER)
    class HelpViewer : public QTextBrowser
    #endif
    

    Is this change to blame?

    From what I can see QWebView is now gone from the SDK. Would it be easy to migrate to the new code? If not, I think I'm safest to just switch back to Qt 5.5, which I believe includes QWebView.

    Thanks,


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Yes, QTextBrowser is less featured rendering wise that QtWebKit or even QtWebEngine. QtWebKit has been deprecated in Qt 5.5 and removed since 5.6. If you need QtWebKit, you can still build the module from sources, it's available.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.