[Qt-interest] adding a QGraphicsPixmapItem

pmqt71 pmqt71 at gmail.com
Fri Oct 22 00:42:32 CEST 2010


I'm using Qt 4.6.2 on xp, VC++ Express 2008.

I partially solved overriding the paint method and drawing the pixmap using
the painter:

painter->drawPixmap(0, 0, 20, 20, m_pixmap);

But I still have the strange problem calling the scene's update method after
moving the pixmap:

class MyQGraphicsPixmapItem: public QGraphicsPixmapItem
{
...
void advance(int step)
{
    if(!step) return;
    moveBy(1, 0);

    //ok
    this->scene()->update();

    //nok, the pixmap starts from the scene's center and moves to its
position.
    //this->scene()->update( 0, 0, 20, 20);

}
};

I'm now searching the documentation to improve the update part, but I'd like
to know what causes the strange animation.

pm


2010/10/21 Malyushytsky, Alex <alex at wai.com>

>  What version of Qt you are using?
>
> That sounds weird, when I use QGraphicsPixmapItem it just displayed at the
> location it supposed to be .
>
>
>
> Alex
>
>
>
> *From:* qt-interest-bounces at trolltech.com [mailto:
> qt-interest-bounces at trolltech.com] *On Behalf Of *pmqt71
> *Sent:* Thursday, October 21, 2010 6:17 AM
> *To:* qt-interest at trolltech.com
> *Subject:* [Qt-interest] adding a QGraphicsPixmapItem
>
>
>
> Hi all,
>
> adding a QGraphicsPixmapItem on a QGraphicsScene, I see a short animation
> showing the pixmap moving from the scene's center to the top-right corner.
>
> How to disable this effect? I just want the pixmap in the top-right corner
> of the scene.
>
>
> the statement is:
> QGraphicsPixmapItem* item = gs->addPixmap(pixmap);
>
> thanks
>
> pm
>
>
>
>
>
>
>
> ---------------------------------------------------------------------------------------------------
> Weidlinger Associates, Inc. made the following annotations.
>
> “This message and any attachments are solely for the intended recipient and
> may contain confidential or privileged information. If you are not the
> intended recipient, any disclosure, copying, use, or distribution of the
> information included in this message and any attachments is prohibited. If
> you have received this communication in error, please notify us by reply
> e-mail and immediately and permanently delete this message and any
> attachments. Thank you.”
>
> “Please consider our environment before printing this email.”
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101022/9488a5bb/attachment.html 


More information about the Qt-interest-old mailing list