[Qt-interest] QGraphicsItem movement problem

Riccardo Roasio riccardo.roasio at gmail.com
Fri Jul 16 09:12:43 CEST 2010


Hi,

i tried to remove the stdout but nothing change.
I will try to animate it from position to position...

Riccardo

2010/7/15 Jason H <scorp1us at yahoo.com>:
> Any string output will suck. I'd try it without the cout.
> I'd provide a QTextDocument in another window, use qRegisterMsghandler(), and
> use qDebug() to post text to it.
>
> The other thing is to animate it from position to position.
>
>
>
>
>
>
> ----- Original Message ----
> From: Riccardo Roasio <riccardo.roasio at gmail.com>
> To: qt-interest <qt-interest at trolltech.com>
> Sent: Thu, July 15, 2010 9:00:57 AM
> Subject: [Qt-interest] QGraphicsItem movement problem
>
> Hi,
>
> i'm implementing a movement of a QGraphicsItem due to mouse press and movement..
>
>   currentMovement=event->pos().x();
>
>     if(currentMovement<startMovement)
>     {
>      //movememnt is right to left
>      int delta=startMovement-currentMovement;
>      currentX=startX-delta;
>
>      std::cout<<"DELTA : "<<delta<<std::endl;
>      std::cout<<"currentX : "<<currentX<<std::endl;
>
>      setPos(currentX,startY);
>      update();
>     }
>
>
> the problem is that the effect is not so fluid, but the continuous
> refresh create a blinking effect of the item..
>
> I can i solve this problem?
>
> Thanks,
> Riccardo
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
>
>
>
>




More information about the Qt-interest-old mailing list