onMousePressEvent callback of ccGLWindow has delay
Posted: Wed Apr 10, 2019 8:22 am
Hi everyone,
I used cloudcompare for research recently, and I have a problem.
I want to implement a function just like drawing rectangle on ccGLWindow, just like this:
Then, I connect the onMousePressEvent and onMouseMoveEvent of ccGLWindow in my own Qt Plugin, just like this:
Signal leftButtonClicked is emitted in onMousePressEvent callback of ccGLWindow
Functions left_button_clicked, right_button_clicked, mouse_moved are all slots I implemented to draw a rectangle.
But the problem occurs, the call of left_button_clicked has a delay.
I print log everywhere, and I found when I click the mouse left button, about 1~2s later, onMousePressEvent of ccGLWindow is called, and then my slot is called.
It seems that the QEvent is too much to be processed and then it is processed later?Did anyone else have the same problem?
I used cloudcompare for research recently, and I have a problem.
I want to implement a function just like drawing rectangle on ccGLWindow, just like this:
Then, I connect the onMousePressEvent and onMouseMoveEvent of ccGLWindow in my own Qt Plugin, just like this:
Code: Select all
connect(glwindow, SIGNAL(leftButtonClicked(int, int)),
this, SLOT(left_button_clicked(int, int)));
connect(glwindow, SIGNAL(rightButtonClicked(int, int)),
this, SLOT(right_button_clicked(int, int)));
connect(glwindow, SIGNAL(mouseMoved(int, int, Qt::MouseButtons)),
this, SLOT(mouse_moved(int, int, Qt::MouseButtons)));
Functions left_button_clicked, right_button_clicked, mouse_moved are all slots I implemented to draw a rectangle.
But the problem occurs, the call of left_button_clicked has a delay.
I print log everywhere, and I found when I click the mouse left button, about 1~2s later, onMousePressEvent of ccGLWindow is called, and then my slot is called.
It seems that the QEvent is too much to be processed and then it is processed later?Did anyone else have the same problem?