Results 1 to 3 of 3

Thread: QTextEdit setText override?

  1. #1
    Join Date
    Mar 2006
    Location
    Troy, Michigan, USA
    Posts
    17
    Thanks
    2
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default QTextEdit setText override?

    I have found a few things that allow me to get around Qt's html parser problems and would like to apply them when the QTextEdit::setText member if called. Unfortunetly, this is not a virtual member. Currently I am using the source changed signal, getting the current text, appling the fixes, and setting it again, but that means that the text needs to be parsed twice.

    Does anyone know a way around this?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QTextEdit setText override?

    I can't think of any other way than declaring your own custom method which applies the fix first and then passes the fixed text to the QTextEdit::setText(). This would require chaning all occurrences of QTextEdit::setText() in your project to the "fixed" method instead.
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    ksierens (24th November 2006)

  4. #3
    Join Date
    Mar 2006
    Location
    Troy, Michigan, USA
    Posts
    17
    Thanks
    2
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTextEdit setText override?

    Thanks, actually, I just realize that the QTextBrowser::setSource function is virtual, so I think I could handle it there.

Similar Threads

  1. Re-implement mouse events of QTextEdit
    By Ankitha Varsha in forum Qt Programming
    Replies: 2
    Last Post: 14th October 2006, 16:55
  2. QTextEdit API questions (plain text)
    By Gaspar in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 06:03
  3. [QT 4] QTextEdit performance
    By fellobo in forum Qt Programming
    Replies: 8
    Last Post: 6th March 2006, 19:27
  4. Painting to QTextEdit
    By gesslar in forum Qt Programming
    Replies: 8
    Last Post: 18th February 2006, 18:40
  5. Obtaining clean (x)html from QTextEdit
    By ccf_h in forum Qt Programming
    Replies: 1
    Last Post: 5th February 2006, 14:47

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.