Fixed double click not doing anything.

This commit is contained in:
leo 2014-04-26 06:23:12 +00:00
parent c7cdb96abb
commit 9c40092395
2 changed files with 21 additions and 0 deletions

View file

@ -248,6 +248,26 @@ void lcQGLWidget::mouseReleaseEvent(QMouseEvent *event)
}
}
void lcQGLWidget::mouseDoubleClickEvent(QMouseEvent *event)
{
float scale = deviceScale();
widget->mInputState.x = event->x() * scale;
widget->mInputState.y = widget->mHeight - event->y() * scale - 1;
widget->mInputState.Control = (event->modifiers() & Qt::ControlModifier) != 0;
widget->mInputState.Shift = (event->modifiers() & Qt::ShiftModifier) != 0;
widget->mInputState.Alt = (event->modifiers() & Qt::AltModifier) != 0;
switch (event->button())
{
case Qt::LeftButton:
widget->OnLeftButtonDoubleClick();
break;
default:
break;
}
}
void lcQGLWidget::mouseMoveEvent(QMouseEvent *event)
{
float scale = deviceScale();

View file

@ -33,6 +33,7 @@ protected:
void keyReleaseEvent(QKeyEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void mouseDoubleClickEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void wheelEvent(QWheelEvent *event);
void dragEnterEvent(QDragEnterEvent *event);