Results 1 to 14 of 14

Thread: Using HTML and CSS in QT Help System

  1. #1
    Join Date
    May 2006
    Posts
    108
    Thanks
    35
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question Using HTML and CSS in QT Help System

    Hi,

    is it possible to use cascading style sheet with the Qt Assistant? I attemtped to load my own profile with references to HTML files that contained references to a style.css file that i had, but the html files were displayed in a different style as in my webbrowser. What can i do?

    Thanks in advance,

    Whitefurrows

  2. #2
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Using HTML and CSS in QT Help System

    The Qt rich text engine does support a limited set of CSS. But it doesn't support external stylesheets yet. You'll need to include them in the HTML text. See the documentation for "Supported HTML Subset" for mroe information.

  3. #3
    Join Date
    May 2006
    Posts
    108
    Thanks
    35
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question Re: Using HTML and CSS in QT Help System

    The Supported HTML Subset it's not enough. I have many html files and the layout is given with my style.css. It's necessary to use my style.css and CSS Properties like, margin, padding, position, overflow, height, border and some from the given CSS Properties. You menan i must include all css property in my html files and can't use <link rel> and <div>? I think that's dirty, have i no other possibility ?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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: Using HTML and CSS in QT Help System

    Sure you have. You can embed a real html browser into your application

  5. #5
    Join Date
    May 2006
    Posts
    108
    Thanks
    35
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question Re: Using HTML and CSS in QT Help System

    The reason why i wont to use the assistant is the programm must run without other software. Or have i a chance to implement the code of a real html browser and can sell my software?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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: Using HTML and CSS in QT Help System

    Assistant is not a real html browser - it uses QTextBrowser to render the content. I meant something like Gecko or IE.

  7. #7
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Using HTML and CSS in QT Help System

    Quote Originally Posted by whitefurrows View Post
    I think that's dirty, have i no other possibility ?
    As stated previously, QTextBrowser is not an HTML browser engine. It is a simple rich text widget that can handle links and external resources. There are people working on porting Apple's WebKit back to Qt, so soon there will be a free crossplatform HTML browser engine available. But right now there is not.

    Do you really need to embed an HTML browser in your application? A very good alternative is to use QDesktopServices. Give it an URL and it will launch the current desktop's configured browser. Then you can use Javascript, frames, CSS3, etc, to your heart's content.

  8. #8
    Join Date
    May 2006
    Posts
    108
    Thanks
    35
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question Re: Using HTML and CSS in QT Help System

    The profiles and full text searching in all documents, is that what i need. I can't do that with a HTML browser. My plan was to modify the assistant, but i have no idea how can i do that. You know library they can do?

  9. #9
    Join Date
    Feb 2007
    Posts
    24
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Using HTML and CSS in QT Help System

    Webkit is available in the 4.4 beta and recent snapshots. The /demos directory contains a demo browser developed by benjamin Meyer. It works great! Netscape plugins and flash support are on the way. Read the white paper located on this page.
    The integration capabilities are awesome. I'm so excited.

    -travlr

  10. #10
    Join Date
    May 2006
    Posts
    108
    Thanks
    35
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Smile Re: Using HTML and CSS in QT Help System

    Hi,

    we have include a css like this:
    Qt Code:
    1. <link rel="stylesheet" media="all" type="text/css" href="../../css/mycss.css" />
    To copy to clipboard, switch view to plain text mode 
    and use only the supported css properties for qt's rich text engine.

    That's worke fine but it's nice to know that qt has include the webkit, thank you!

  11. #11
    Join Date
    Jan 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Using HTML and CSS in QT Help System

    This seems to work with QWebView but not with the same web page used as a help file within Qt Assistant. Why not?

  12. #12
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Using HTML and CSS in QT Help System

    As far as I know Qt Assistant is based on QTextBrowser which only supports a small HTML subset.
    Last edited by Lykurg; 10th January 2012 at 20:46. Reason: spelling corrections

  13. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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: Using HTML and CSS in QT Help System

    Assistant can use one of two backends -- QTextBrowser or QWebView. It's decided compile-time, so one might need to rebuild Assistant.
    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.


  14. #14
    Join Date
    May 2012
    Location
    Belgium
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Using HTML and CSS in QT Help System

    So as I understand it, it's not really possible with a QHelpEngine to generate css in a QWebView?

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.