Results 1 to 4 of 4

Thread: Html text To QString

  1. #1
    Join Date
    Sep 2011
    Location
    India
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Html text To QString

    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.

  2. #2
    Join Date
    Sep 2011
    Location
    India
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Html text To QString

    Solved....

  3. #3
    Join Date
    Mar 2012
    Location
    Tver, Russia
    Posts
    9
    Thanks
    1
    Thanked 3 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Html text To QString

    Please, tell us how do you solved this problem

  4. #4
    Join Date
    Sep 2011
    Location
    India
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Html text To QString

    i have Done it by using "QTextDocument"

Similar Threads

  1. Replies: 0
    Last Post: 2nd August 2010, 10:37
  2. Replies: 2
    Last Post: 16th May 2010, 18:23
  3. put html text into a qtextedit
    By dreamer in forum Qt Programming
    Replies: 2
    Last Post: 8th May 2008, 20:44
  4. Display '<' as HTML in QString
    By mclark in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2007, 22:43
  5. QPushButton and HTML text
    By ivan.cukic in forum Qt Programming
    Replies: 2
    Last Post: 20th March 2007, 14:48

Tags for this Thread

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.