Results 1 to 5 of 5

Thread: problem with qwebview

  1. #1
    Join Date
    Sep 2010
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default problem with qwebview

    I'm developing a simple bill generator. For that i have to use HTML to format the output, and generate a pdf file or print a bill.
    In the first module, the output goes to a pdf file, formatted using html.

    I can use QTextDocument, and then its setHtml() function, but it does not have good looks [older version of css i guess]

    i tried to use QWebView, it looked superb [in the pdf file], except that, the logo was not visible. so, <img> is not working.


    I searched everywhere for its solution, and tried these:

    - use a png file instead of jpg file
    - copy/paste the folder imageformats from plugins directory to current directory
    - give the absolute path [i gave "file:///home/user/Bill.jpg"]
    - set base url [i set "file:///home/user/Bill" as base url]

    none of the above solutions worked.

    what should i do to get images there?

    or is there any alternative to QWebView? or any thing which i can use for printing better quality bills?

  2. #2
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    28
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: problem with qwebview

    Did you compile qt yourself and may you forgot the image librarys?

    If not then I would try to add the picture to my resource file and to load it then.

  3. #3
    Join Date
    Sep 2010
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: problem with qwebview

    i did it using qt creator

    and it is showing the image when i'm using qtextdocument.sethtml()

  4. #4
    Join Date
    Sep 2010
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: problem with qwebview

    updates...

    i used the same code, in a new project.

    when i'm displaying the html on the QWebView, it is showing the image. but the image is not present when it is printing to a file using qprinter.

    any suggestions?

  5. #5
    Join Date
    Sep 2010
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: problem with qwebview

    got it.!!!

    i had to wait for the images to load... so i used the signal webview's signal loadFinished().. and that did the job

Similar Threads

  1. Problem with QwebView
    By moh.gup@gmail.com in forum Qt Programming
    Replies: 3
    Last Post: 17th September 2010, 14:22
  2. Problem With QWebView
    By traxtopel in forum Qt Programming
    Replies: 2
    Last Post: 25th February 2010, 18:01
  3. QWebView problem
    By wirasto in forum Qt Programming
    Replies: 2
    Last Post: 19th November 2009, 02:32
  4. Problem in QWebView
    By navi1084 in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2008, 19:27
  5. QWebView problem with pdf
    By oscar in forum Qt Programming
    Replies: 5
    Last Post: 23rd August 2008, 15:37

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
  •  
Qt is a trademark of The Qt Company.