[Qt-interest] QGraphicsItem movement problem

Jason H scorp1us at yahoo.com
Thu Jul 15 18:51:12 CEST 2010


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