Many thanks anda_skoa.
I have reduced the program to the minimum level to show where is the problem and the files are attached.
In the glwidget.cpp file the mousePressEvent, mouseMoveEvent and mouseReleaseEvent have been overloaded as follows:
void GLWidget::mousePressEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton) QMessageBox::critical(0,0,"left","");
if (event->button() == Qt::RightButton) QMessageBox::critical(0,0,"right","");
}
void GLWidget::mouseMoveEvent(QMouseEvent *event) { }
void GLWidget::mouseReleaseEvent(QMouseEvent *event) { }
Thus nothing should happen when the mouse is moved without clicking the buttons, while a message box with the text "left" or "right" should open when one of the buttons is clicked.
Everything works fine till I click the right button. Then the message box is correctly displayed, but then it continues to be displayed when the mouse is moved without any further button clicking. Why????
It doesn't happen with the left button.
I guess that the problem is not with the code and that it depends on some malfunctioning of my mouse (actually, a trackpad) or on a bug with Qt5.
Do anyone can give me some advice?
Many thanks in advance
Enrico
Bookmarks