Answer the question
In order to leave comments, you need to log in
How to track mouse movement over a WebView in QT?
There is a small project (QWidget)
Simple code:
void MainWindow::mouseMoveEvent(QMouseEvent *event)
{
QString str = QString::number(event->y());
ui->label->setText(str);
}
Answer the question
In order to leave comments, you need to log in
class MyView : public QWebView
{
Q_OBJECT
public:
MyView(QWidget *parent = 0) : QWebView(parent) {
setMouseTracking(true);
}
void mouseMoveEvent(QMouseEvent *event) {
qDebug() << event->x() << ", " << event->y();
}
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question