Problem got my attention so I quickly implemented a test app.

Qt Code:
  1. #ifndef FILTER_H
  2. #define FILTER_H
  3.  
  4. #include <QtCore>
  5. #include <QtGui>
  6. #include <QDebug>
  7. #include <QtScript>
  8.  
  9. class MoveEventFilter : public QObject
  10. { Q_OBJECT
  11.  
  12. public:
  13. MoveEventFilter(QWidget* parent = 0) : QObject(parent) {
  14. canMove = false;
  15. }
  16. bool canMove;
  17.  
  18. protected:
  19. bool eventFilter(QObject *obj, QEvent *event)
  20. {
  21. QMetaObject mo = QEvent::staticMetaObject;
  22. qDebug() << obj->objectName() << mo.enumerator(mo.indexOfEnumerator("Type")).valueToKey(event->type());
  23.  
  24. if (event->type() == QEvent::MouseMove ){
  25. QMouseEvent* me = static_cast<QMouseEvent*>(event);
  26. qDebug() << QString("(%1|%2)").arg(me->pos().x()).arg(me->pos().y());
  27. return true;
  28. }
  29.  
  30. return QObject::eventFilter(obj, event);
  31. }
  32. };
  33.  
  34. class MouseTrack : public QLabel
  35. { Q_OBJECT
  36. public:
  37. MouseTrack(QWidget* parent = 0) : QLabel(parent) {
  38. }
  39. };
  40.  
  41. #endif // FILTER_H
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. #include <QtCore>
  2. #include <QtGui>
  3.  
  4. #include "filter.h"
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. QApplication a(argc, argv);
  9.  
  10. QTextEdit* te = new QTextEdit();
  11. te->setObjectName("textedit");
  12.  
  13. MouseTrack* mt = new MouseTrack();
  14. mt->setMinimumHeight(100);
  15. mt->setObjectName("MouseTrack");
  16.  
  17. MoveEventFilter* filter = new MoveEventFilter();
  18.  
  19. te->setMouseTracking(true);
  20. te->installEventFilter(filter);
  21. mt->setMouseTracking(true);
  22. mt->installEventFilter(filter);
  23.  
  24. QVBoxLayout* vl = new QVBoxLayout();
  25. vl->addWidget(te,0);
  26. vl->addWidget(mt,1);
  27. w.setLayout(vl);
  28. w.show();
  29.  
  30. QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
  31.  
  32. return a.exec();
  33. }
To copy to clipboard, switch view to plain text mode 
If you play around with it a bit, you see that, that MouseMoves are filtered on the textedit, but only on the border!!

I guess the main text edit is some subwidget?

Joh

PS: I took the time and figured out how to convert those QEvent::type codes into readable names.
Qt Code:
  1. QEvent::staticMetaObject.enumerator(QEvent::staticMetaObject.indexOfEnumerator("Type")).valueToKey(event->type());
To copy to clipboard, switch view to plain text mode