View Full Version : Writing a html file in Qt4
AviMittal
22nd July 2009, 15:22
Hi
I have a problem,I have some data in a c++ structure. I want to write that data in some html file . Sothat i can read that html file in my QTextEdit .
Now my question is how to generate this HTML file from strcuture data at run time in Qt4. Pleaseeeeeeeee help.
Lykurg
22nd July 2009, 15:38
Hi
I have a problem,I have some data in a c++ structure. I want to write that data in some html file . Sothat i can read that html file in my QTextEdit .
Now my question is how to generate this HTML file from strcuture data at run time in Qt4. Pleaseeeeeeeee help.
:confused: loop through your structure data and append it to a HTML string, you create.
AviMittal
23rd July 2009, 05:11
thanks for rplying. But how to append "html" string ?? my html file looks like:
<HTML>
<HEAD>
<TITLE><TITLE>
</HEAD>
<BODY>
<Table border="0" cellpadding="0" cellspacing="0" style="Width:100%;">
<TR>
<TD>
<Table border="0" cellpadding="0" cellspacing="0" style="Width:100%;">
<TR>
<TD COLSPAN="2"><BR /></TD>
</TR>
<TR style="background-color:LightBlue;">
<TD>
To:</TD>
<TD>aavriti.goyal@TCS.com; aavriti.mittal@gmail.com</TD>
</TR>
<TR style="background-color:LightBlue;">
<TD>
Attachments:
</TD>
<TD>Sample.doc</TD>
</TR>
</table>
</TD>
</TR>
<TR>
<TD>
<Table border="0" cellpadding="0" cellspacing="0" style="Width:100%;">
<TR style="font-size:5pt;"><TD> </TD></TR>
<TR>
<TD>Classification:</TD>
<TD>Classification Value</TD>
</TR>
<TR>
<TD>Authorized By:</TD>
<TD>DTG Value</TD>
it contains double quotes as well that QString doesnt understand. pls suggest.
aamer4yu
23rd July 2009, 05:33
For double quotes, cant you use - \" ??
Something like -
QString htmlString = QString("<HTML> <BODY> <Table border=\"0\" ..... .... </HTML>");
:rolleyes:
AviMittal
23rd July 2009, 10:21
it didnt worked :(
faldzip
23rd July 2009, 11:43
what didn't work?
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.