Hi guys, In the following code:
//! Pressed? bool pressed; //! Position. QPoint pos; //! Mouse move delta. int delta; void Envelope::mousePressEvent( QMouseEvent * e ) { if( e->button() == Qt::LeftButton ) { d->pressed = true; d->pos = e->pos(); d->delta = 0; } e->accept(); } void Envelope::mouseMoveEvent( QMouseEvent * e ) { if( d->pressed ) { const QPoint delta = d->pos - e->pos(); d->delta += delta.manhattanLength(); d->pos = e->pos(); e->accept(); emit moved( delta.x() ); } else e->ignore(); } emit moved( delta.x() ) emits the next deltas with one direction mouse move: 12 -10 11 -9 etc. I can't understand what I am doing wrong. Is this my mistake, or my mouse is broken, or something else? Thank you. -- Best Regards, Igor Mironchik. _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest