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 TextArea displays gif?
Forum Updated to NodeBB v4.3 + New Features

How TextArea displays gif?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 2 Posters 502 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.
  • S Offline
    S Offline
    senmx
    wrote on last edited by
    #1
    TextArea {
        id: ta
        smooth: true
        text: '<img src="qrc:/x.gif"/>'
        textFormat: Text.RichText
        selectionColor: "#3399FF"
        selectByMouse: true
        selectByKeyboard: true
        wrapMode: TextEdit.Wrap
    }
    

    Do I need to extend TextArea with C++ ?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Well... does it work? If yes, then you don't need to extend anything. If not - just use AnimatedImage.

      (Z(:^

      S 1 Reply Last reply
      0
      • sierdzioS sierdzio

        Well... does it work? If yes, then you don't need to extend anything. If not - just use AnimatedImage.

        S Offline
        S Offline
        senmx
        wrote on last edited by
        #3

        @sierdzio I just want to use TextArea's ability to display html, If I use AnimatedImage, you need to process html and display gif at the same time.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Only a subset of HTML is supported - https://doc.qt.io/qt-5/richtext-html-subset.html.

          If it does not work for you like that, do this:

          • try with a .jpg or .png to see if this works at all
          • try different URL schemes: src=":/x.gif", src="://x.gif", src="qrc://x.gif". QRC is always very fragile when it comes to schemes

          (Z(:^

          S 1 Reply Last reply
          2
          • sierdzioS sierdzio

            Only a subset of HTML is supported - https://doc.qt.io/qt-5/richtext-html-subset.html.

            If it does not work for you like that, do this:

            • try with a .jpg or .png to see if this works at all
            • try different URL schemes: src=":/x.gif", src="://x.gif", src="qrc://x.gif". QRC is always very fragile when it comes to schemes
            S Offline
            S Offline
            senmx
            wrote on last edited by
            #5

            @sierdzio Thanks!

            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