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. QMovie on QLabel starts not in full size

QMovie on QLabel starts not in full size

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.4k 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.
  • G Offline
    G Offline
    Gourmand
    wrote on last edited by
    #1

    I use QMovie on QLabel and QGraphicsProxyWidget to show animated GIF over QGraphicsItem placed on QGraphicsScene. Almost all works fine except one - at first start I see not entire GIF but only small left part of it. After I drag QGraphicsItem over scene (QDrag is used for it) - then QMovie fully appears. Exactly QDrag carries just pointer to QGraphicsItem object instead of serialized object.

    All my actions I show here:
    @
    QLabel* aniLabel = new QLabel();
    QMovie* aniMovie = new QMovie( ":/new/prefix1/anim-1-color.gif", QByteArray(), this );
    QGraphicsProxyWidget* aniWidget = new QGraphicsProxyWidget( this );
    aniLabel->setAttribute( Qt::WA_NoSystemBackground );
    aniLabel->setMovie( aniMovie );
    aniWidget->setWidget( aniLabel );
    @

    these actions I perform in constructor of item class derived from QGraphicsItem. To setup position of QGraphicsProxyWidget on QGraphicsItem and show animation I use following code:
    @
    aniWidget->setPos( pic.width() - aniLabel->size().width(),
    pic.height() - aniLabel->size().height() );
    aniLabel->show();
    aniMovie->start();
    @

    it is placed in paint(...) event of item class derived from QGraphicsItem.

    My question is - are there some necessary actions to be done with QMovie before show it with QLavel? Or may be this is a problem with QLabel itself?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      Gourmand
      wrote on last edited by
      #2

      I SOLVED!! There is a bug in QMovie implementation. After first setting animated GIF it accepts size of only first frame. To properly initialize image properties from all frames QMovie must be started and stopped right now.

      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