Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. can QStyledItemDelegate::paint(), QIcon visulize dynamic .gif picture?

can QStyledItemDelegate::paint(), QIcon visulize dynamic .gif picture?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.1k 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.
  • O Offline
    O Offline
    opengpu2
    wrote on last edited by
    #1

    can QStyledItemDelegate::paint(), QIcon visulize dynamic .gif picture?

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Not directly but it's doable. The paint() method is called "on demand" i.e. when the view needs to update in response to some event or signal.
      An animation requires a steady rate of updates.

      One way to do it would be to use a QMovie to play the gif. Then in paint() you would paint the currentPixmap() of the movie. Last piece of the puzzle is making sure the painting is requested regularly. You could start a timer that would emit the dataChanged signal from the model for the animated item.

      O 1 Reply Last reply
      1
      • Chris KawaC Chris Kawa

        Not directly but it's doable. The paint() method is called "on demand" i.e. when the view needs to update in response to some event or signal.
        An animation requires a steady rate of updates.

        One way to do it would be to use a QMovie to play the gif. Then in paint() you would paint the currentPixmap() of the movie. Last piece of the puzzle is making sure the painting is requested regularly. You could start a timer that would emit the dataChanged signal from the model for the animated item.

        O Offline
        O Offline
        opengpu2
        wrote on last edited by
        #3

        @Chris-Kawa thank you

        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