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. How can I draw an image into TextArea without HTML?
Forum Update on Monday, May 27th 2025

How can I draw an image into TextArea without HTML?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 4 Posters 970 Views
  • 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.
  • H Offline
    H Offline
    hobbe
    wrote on last edited by
    #1

    QTextEdit can add an image through insertImage,and implement QTextObjectInterface to draw custom object.
    But don't work on TextArea.

    raven-worxR 1 Reply Last reply
    0
    • H hobbe

      QTextEdit can add an image through insertImage,and implement QTextObjectInterface to draw custom object.
      But don't work on TextArea.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @hobbe said in How can I draw an image into TextArea without HTML?:

      But don't work on TextArea.

      about what TextArea are you talking exactly? You mean inside a QWebEngineView?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      JonBJ 1 Reply Last reply
      0
      • raven-worxR raven-worx

        @hobbe said in How can I draw an image into TextArea without HTML?:

        But don't work on TextArea.

        about what TextArea are you talking exactly? You mean inside a QWebEngineView?

        JonBJ Online
        JonBJ Online
        JonB
        wrote on last edited by JonB
        #3

        @raven-worx
        I assumed he meant https://doc.qt.io/qt-5/qml-qtquick-controls-textarea.html, since we're in a QML forum.

        raven-worxR 1 Reply Last reply
        1
        • JonBJ JonB

          @raven-worx
          I assumed he meant https://doc.qt.io/qt-5/qml-qtquick-controls-textarea.html, since we're in a QML forum.

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by raven-worx
          #4

          @JonB
          oh yea... of course.

          Then no. You have access to it's QTextDocument, but its not allowed to be modified

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          J.HilkJ 1 Reply Last reply
          2
          • raven-worxR raven-worx

            @JonB
            oh yea... of course.

            Then no. You have access to it's QTextDocument, but its not allowed to be modified

            J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote on last edited by
            #5

            @raven-worx I didn‘t know there were classes one isn‘t supposed to modfy, look at that...

            Since this is in qml, you could simply add an Image element on top of your textarea,
            it will require a good amount of micro managment, aligning, show not to show logic etc. but should be possible.


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            H 1 Reply Last reply
            0
            • J.HilkJ J.Hilk

              @raven-worx I didn‘t know there were classes one isn‘t supposed to modfy, look at that...

              Since this is in qml, you could simply add an Image element on top of your textarea,
              it will require a good amount of micro managment, aligning, show not to show logic etc. but should be possible.

              H Offline
              H Offline
              hobbe
              wrote on last edited by
              #6

              @J.Hilk said in How can I draw an image into TextArea without HTML?:

              @raven-worx I didn‘t know there were classes one isn‘t supposed to modfy, look at that...

              Since this is in qml, you could simply add an Image element on top of your textarea,
              it will require a good amount of micro managment, aligning, show not to show logic etc. but should be possible.

              I'm now drawing image on top of textarea,but the performance is very bad(will cause the textedit blink).
              My solution is to draw image on QImage and then create an texturenode add into TextNode.but draw QImage is low performance,is a way can draw image to the texture directly by opengl?

              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