Please suggest some example for capturing mouse movement co-ordinates X,Y position in the entire windiow??
-
Something like this?
@
#ifndef WIDGET_H
#define WIDGET_H#include <QWidget>
#include <QString>
#include <QMouseEvent>class Widget : public QWidget
{
Q_OBJECTpublic:
explicit Widget(QWidget *parent = 0) : QWidget(parent) {
setMouseTracking(true);
}protected:
void mouseMoveEvent(QMouseEvent *e) {
QString str = QString("Mouse is at (%1,%2).").arg(e->x()).arg(e->y());
setWindowTitle(str);
}
};#endif // WIDGET_H
@Caveat: just quick and dirty. I haven't tested the code.