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 show Text and gif in QML Text Element like weibo
Forum Updated to NodeBB v4.3 + New Features

QML show Text and gif in QML Text Element like weibo

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 3 Posters 1.2k 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.
  • T Offline
    T Offline
    toby520
    wrote on last edited by
    #1

    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
    0
    • C Offline
      C Offline
      cuongkjm
      wrote on last edited by
      #2

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

      L 1 Reply Last reply
      0
      • C cuongkjm

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

        L Offline
        L Offline
        lemons
        wrote on last edited by
        #3

        @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
        0

        • Login

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