Results 1 to 3 of 3

Thread: problem displaying html code in QTextEdit

  1. #1
    Join Date
    Mar 2008
    Posts
    55
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default problem displaying html code in QTextEdit

    Hello everybody, I've to print a facutre model. Thats why I've created a html code corresponding to the model and after I'm displying it in a QTextEdit. After that the user can print the facture. The is that the facture displayed is not corresponding to the html code especially the table borders.
    I've used the functionnalities as the Qt documentation but it not working, can anybody tell me where I'm wrong and what I must to change to have the right display.
    There's my html code :
    Qt Code:
    1. <html><head> <meta content='facture' name='GENERATOR'><meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>
    2. <style type="text/css">
    3. body { margin-top:50px; margin-bottom:20px; margin-left:100px; margin-right:100px; padding: 0; font-family: verdana, Tahoma, arial, sanf-serif; }
    4. ul { type:none; }
    5. .no_bord { border-style:none; }
    6. .bord { border-style:solid; }
    7. .bord_color { border-color:black; }
    8. .ste { font-size:8px; }
    9. .abonne { font-size:10px; }
    10. </style> </head>
    11. <body>
    12. <table border="1" style="border-style:solid; border-color:white;" cellspacing="0" cellpadding="0">
    13. <tr> <td style="border-style:none;">&nbsp;</td> <td style="border-style:none;">&nbsp;</td>
    14. <td style="border-style:none;">&nbsp;</td> <td style="border-style:none;">&nbsp;</td>
    15. </tr><tr border="none" ><td class="ste" colspan=4 border="none">38, rue de paris</td></tr>
    16. <tr><td class="ste" colspan=4 border="none">10002 PARIS</td></tr><tr border="none" ><td class="ste" colspan=3 border="none">Tel : 01 23 45 67 89</td><td class="abonne" colspan=3 border="none">XXXXX YYYYYY</td></tr><tr border="none" ><td class="ste" colspan=3 border="none">Fax : 01 23 45 67 89</td><td class="abonne" colspan=3 border="none">00000 LIEU RESIDENCE</td></tr><tr border="none" ><td class="ste" colspan=3 border="none">Mail : commercial@ste.fr</td><td class="abonne" colspan=3 border="none">xxxxx@wanadoo.fr</td></tr><tr border="none" ><td class="nous" colspan=3 border="none">&nbsp;</td><td class="abonne" colspan=3 border="none">01 23 45 67 89</td></tr><tr><td border="none" colspan=4>&nbsp;</td></tr><tr><td border="none" colspan=4>&nbsp;</td></tr><tr><td colspan="4" border="none" align="center" style="font-size:16pt; font-weight:bold">FACTURE N° 2009T0008</td></tr><tr><td border="none" colspan="4" align="center" style="font-size:12pt; font-weight:bold"> Du : 07 septembre 2009</td></tr><tr><td style="border-style:none;" colspan=4>&nbsp;</td></tr><tr><td style="border-style:none;" colspan=4>&nbsp;</td></tr><tr><td colspan="4" style="border-style:none;font-size:13pt; font-weight:bold"> Licence d'utilisation du notre logiciel</td></tr><tr border="1" style="border-color:black;font-size:11pt;font-weight:bold;background-color:gray;"><td style=" border-color:black; margin-left:10px; margin-right:5px; font-size:10pt;font-weight:600;" width="30%">NOM</td><td style=" border-color:black; margin-left:10px; margin-right:5px; font-size:10pt;font-weight:600;" width="30%">Prénom</td><td style=" border-color:black; margin-left:10px; margin-right:5px; font-size:10pt;font-weight:600;" width="10%">Durée</td><td style=" border-color:black; margin-left:10px; margin-right:5px; font-size:10pt;font-weight:600;" width="30%" align="right">Montant HT</td></tr><tr border="1" style="border-color:black;font-size:9pt;"><td style=" border-color:black; margin-left:10px; margin-right:5px; font-size:9pt;">XXXXXX</td><td style=" border-color:black; margin-left:10px; margin-right:5px; font-size:9pt;">YYYYYY</td><td style=" border-color:black; margin-left:10px; margin-right:5px; font-size:9pt;">1 an </td><td style=" border-color:black; margin-left:10px; margin-right:5px; font-size:9pt;" align="right">150.51</td></tr><tr style="font-size:10pt;"><td colspan=3 align="right" style="border-style:none;">Total HT : </td><td align="right" style="border-color:black;" >150.51</td></tr><tr style="font-size:10pt;"><td style="border-style:none;" colspan=3 align="right">TVA 19.6 % : </td><td border="1" style="border-color:black;" align="right">29.49</td></tr><tr style="font-size:10pt;"><td style="border-style:none;" colspan=3 align="right">Total TTC : </td><td border="1" style="border-color:black;" align="right">180</td></tr><tr style="font-size:10pt"><td style="border-style:none;" colspan=3 align="right">Versé le 04/09/2009 : </td><td border="1" style="border-color:black;" align="right">180</td></tr><tr style="font-size:10pt"><td style="border-style:none;" colspan=3 align="right">Restant du : </td><td border="1" style="border-color:black;" align="right">0</td></tr><tr><td style="border-style:none;" colspan=4 style="font-size:12pt">Merci de votre confiance</td></tr></table></body></html>
    To copy to clipboard, switch view to plain text mode 
    Many thanks in advance
    Best regards.

  2. #2
    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: problem displaying html code in QTextEdit

    What is "not working"?
    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
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: problem displaying html code in QTextEdit

    For full Html display check QWebView.

    For rich text browser with hypertext navigation check QTextBrowser.

Similar Threads

  1. Problem closing a QMainWindow in Qt4.2
    By ian in forum Qt Programming
    Replies: 11
    Last Post: 17th October 2006, 00:49
  2. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 21:41
  3. QTextEdit problem
    By vijay anandh in forum Qt Programming
    Replies: 1
    Last Post: 14th July 2006, 11:56
  4. setting cursor problem in QTextEdit
    By jyoti kumar in forum Qt Programming
    Replies: 3
    Last Post: 19th May 2006, 08:17
  5. Problem with inserting text into QTextEdit
    By xorrr in forum Qt Programming
    Replies: 0
    Last Post: 6th February 2006, 11:45

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.