PDA

View Full Version : Html text To QString



un9tsandeep
28th March 2012, 15:01
Dear all please help Me to solve my Problem.....


I have HTML Text in a table of My Database it contains The Text and Path if Some images also, Combined text Shows A Question on a web page, now i have to use this database in my Desktop Application, but i am not able to get Exact String from it, i am getting All HTML Tags and notations also in it.

How i can get it in a normal form of a String to put it on my application.

i have tried few things also like

QRegExp("<TH>([a-zA-Z0-9 ]+)</TD>")

And Also

QTextDocument doc;
doc.setHtml(yy);
doc.toPlainText();

but these are not giving me the correct output

my Strings Example is as follows ( which is in the Database)

&lt;p&gt;&lt;img src=\&quot;/stryde/uploadfiles/Image/20070730848933001185786240_02021.gif\&quot; alt=\&quot;\&quot; class=\&quot;\&quot; /&gt;&lt;/p&gt;

and

&lt;font style=&quot;: bold&quot; size=&quot;2&quot;&gt;&lt;spanxx style=&quot;COLOR: windowtext; : Verdana&quot;&gt;The sum of the cubes of three consecutive natural numbers is divisible by&lt;/span&gt;&lt;/font&gt;

please give me some idea to fetch the Correct Output from this HTML text.

un9tsandeep
29th March 2012, 08:23
Solved....

Surendil
29th March 2012, 09:45
Please, tell us how do you solved this problem :)

un9tsandeep
29th March 2012, 12:35
i have Done it by using "QTextDocument"