Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Handle doctype and other html/xml tags inside message - Qt
Forum Updated to NodeBB v4.3 + New Features

Handle doctype and other html/xml tags inside message - Qt

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 2 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    raj.qtdev
    wrote on last edited by
    #1

    Hi all,

    I have got an issue here.

    I am creating a text message something like "Are you :) today?". Since this contains a smiley, i convert this message text to html get the smiley mapping and then display. But this has a problem. All the html tags are working in the message now. For e.g. if the message starts with "<!" characters which comments the whole text line in html is working and all those possible combinations.

    What can i do to fix this issue. I just want to show the text message as typed by the user except when the smilies are present in the message.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cristeab
      wrote on last edited by
      #2

      Try to run a regexp and escape all those special chars. Anyway, only a subset of HTML tags work in Qt rich text box.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        raj.qtdev
        wrote on last edited by
        #3

        do I need to escape those?

        for e.g

        <!This is cool ------ this text should be displayed as it is but right now this shows blank in QLabel text. And removing them is not the solution. Do you have any such regexp btw

        1 Reply Last reply
        0
        • C Offline
          C Offline
          cristeab
          wrote on last edited by
          #4

          You could use rich text documents for displaying such tags (but they will be interpreted as HTML tags):

          http://qt-project.org/doc/qt-4.8/richtext-structure.html

          For regexp in Qt try to search some examples.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved