Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QML show Text and gif in QML Text Element like weibo

    QML and Qt Quick
    3
    3
    917
    Loading More Posts
    • 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.
    • T
      toby520 last edited by

      I meet a serious question when i use text with html like this:
      @
      Rectangle {
      width: 100
      height: 62
      Text {
      id: name
      text: "Qt Project is very useful....<img /> I like it very much"
      anchors.centerIn: parent
      }@

      but result it like this: gif file can't show animation,but png file can show it normal so i need help to show it normal,anybody can know how to do,help please,thx

      1 Reply Last reply Reply Quote 0
      • C
        cuongkjm last edited by

        Did you solve your problem? Could you please share your solutions for this?

        L 1 Reply Last reply Reply Quote 0
        • L
          lemons @cuongkjm last edited by

          @cuongkjm You could simply make a Row and use the AnimatedImage in the center:

          Row {
              spacing: 5
              Text{
                  id: text
                  anchors.verticalCenter: parent.verticalCenter
                  text: "Qt Project is very useful"
              }
              AnimatedImage {
                  anchors.verticalCenter: parent.verticalCenter
                  height: text.height * 2.5
                  fillMode: Image.PreserveAspectFit
                  source: "https://doc.qt.io/qt-5/images/pathview.gif"
              }
              Text{
                  anchors.verticalCenter: parent.verticalCenter
                  text: "I like it very much"
              }
          }
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post