Results 1 to 5 of 5

Thread: QTextEdit insert html

  1. #1
    Join Date
    Feb 2011
    Posts
    5
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default QTextEdit insert html

    Hi

    I'm trying to insert html to get properties like bold, underline, italic. But I have to do from html, because I relocated from html to bbcode, and according to what I found, I can not pass the html style property, so ignore that part ... So I'm putting the properties from the html, I'm using this code:

    Qt Code:
    1. ui->Txt_POST->textCursor().insertHtml("<b>"+ui->Txt_POST->textCursor().selectedText()+"</b>");
    To copy to clipboard, switch view to plain text mode 

    But I don't know how to remove the tags (<b></b>) from html

    Any suggestions?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QTextEdit insert html

    Well I don't get your question... but to remove something from a string use QString::remove() or QString::replace().

  3. #3
    Join Date
    Feb 2011
    Posts
    5
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QTextEdit insert html

    I know. But my problem is that I can't remove the tags <b></b> from the html of the QTextEdit...

    How I can get the html of QTextEdit in a string to remove the tags?

    Thanks for answering

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QTextEdit insert html


  5. #5
    Join Date
    Feb 2011
    Posts
    5
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QTextEdit insert html

    Thanks, that's what I needed

Similar Threads

  1. insert number to qtextEdit
    By Jeneo W. in forum Qt Programming
    Replies: 8
    Last Post: 5th October 2010, 01:58
  2. insert image at the bottom of QTextEdit
    By Cortex in forum Qt Programming
    Replies: 12
    Last Post: 24th October 2009, 15:22
  3. Insert image in RTL QTextEdit problem!
    By SudaNix in forum Newbie
    Replies: 2
    Last Post: 23rd October 2009, 22:53
  4. QTextEdit slow to insert text
    By thomaspu in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2008, 12:05
  5. Replies: 1
    Last Post: 21st March 2007, 14:13

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.