PDA

View Full Version : problem displaying html code in QTextEdit



mourad
7th September 2009, 08:44
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 :

<html><head> <meta content='facture' name='GENERATOR'><meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>
<style type="text/css">
body { margin-top:50px; margin-bottom:20px; margin-left:100px; margin-right:100px; padding: 0; font-family: verdana, Tahoma, arial, sanf-serif; }
ul { type:none; }
.no_bord { border-style:none; }
.bord { border-style:solid; }
.bord_color { border-color:black; }
.ste { font-size:8px; }
.abonne { font-size:10px; }
</style> </head>
<body>
<table border="1" style="border-style:solid; border-color:white;" cellspacing="0" cellpadding="0">
<tr> <td style="border-style:none;">&nbsp;</td> <td style="border-style:none;">&nbsp;</td>
<td style="border-style:none;">&nbsp;</td> <td style="border-style:none;">&nbsp;</td>
</tr><tr border="none" ><td class="ste" colspan=4 border="none">38, rue de paris</td></tr>
<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>
Many thanks in advance
Best regards.

wysota
7th September 2009, 09:18
What is "not working"?

bunjee
7th September 2009, 09:25
For full Html display check QWebView.

For rich text browser with hypertext navigation check QTextBrowser.