Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML custom TextField & Emoji
Forum Updated to NodeBB v4.3 + New Features

QML custom TextField & Emoji

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 2.8k 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.
  • alejandro_pnzA Offline
    alejandro_pnzA Offline
    alejandro_pnz
    wrote on last edited by
    #1

    Hello! I've got a next issue: drawing of the Emoji in QML. Using default TextField, I've known that due to OS-depended font rendering system have different draw results (on site below you can see native emoji rendering on your OS, and on Windows they look ugly and different with Mac OS X). Thus I came to the possible solution as drawing (using QPainter) Emoji Unicode symbols as picture (16x16 in PNG) instead. But I've also found that QML TextField implementation using Qt private API (QQuickTextField - there is no open include files in SDK), and the only class to make own QML component - QQuickItem (QQuickPaintItem), but I think (due to sources of the QQuickTextField) that in this case I need to make full text editor from the scratch. What can be a possible solution in my case?

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @alejandro_pnz TextField doesnot allow rich text. If possible you can use TextArea instead which allows rich text. Since you are considering using images you can do the following:

      TextArea {
          textFormat: TextEdit.RichText
          text: "Hi" + "<img src=\"smiley.png\">"
      }
      

      157

      1 Reply Last reply
      2
      • alejandro_pnzA Offline
        alejandro_pnzA Offline
        alejandro_pnz
        wrote on last edited by alejandro_pnz
        #3

        I am not talking about RichText image drawing, I am talking about custom re-draw function.

        1 Reply Last reply
        0
        • p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          @alejandro_pnz I just suggested an alternative to TextField since you came up with drawing PNG's instead. This would have saved you from adding a custom functionality. Now since you are thinking of creating a text editor may we know how different it would be than using a TextArea ?

          157

          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