Results 1 to 4 of 4

Thread: QTextEdit::toHtml()

  1. #1
    Join Date
    Jul 2006
    Posts
    26
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question QTextEdit::toHtml()

    Hi,
    I have a QTextEdit in which there is text containing HTML tags. The text is displayed in a different size and color. Im trying to get that text in order to display it in a QLabel. The QLabel will display many QString obtained from a QTextEdit.

    I tried the toHtml() function, however, a carrier return always separates each QString and this is not what I want.

    I simply want to store the exact text I see in the QTextEdit to a QString and then display many such QString horizontally.

    thx.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QTextEdit::toHtml()

    don't you need QTextEdit::toPlainText()?

  3. #3
    Join Date
    Jul 2006
    Posts
    26
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTextEdit::toHtml()

    No, this clears all formatting. I have bigger font of different colors.

  4. #4
    Join Date
    Jul 2006
    Posts
    26
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTextEdit::toHtml()

    I solved my problem, but I had to remove some functionnalities.

    If any1 needs to know how I solved it (which I doubt will happen since its a very bad solution) post here and ask.

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.