forked from qt-creator/qt-creator
QmlDesigner.FormEditor: Skip all move events between a 30 ms time frame
To many move events will stall the local sockets. Change-Id: Iec9a072a6c2e217d19c656d5596c40167ca97675 Reviewed-on: http://codereview.qt.nokia.com/2222 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
@@ -275,12 +275,17 @@ void FormEditorScene::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
|
||||
void FormEditorScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->buttons())
|
||||
currentTool()->mouseMoveEvent(removeLayerItems(items(event->scenePos())), event);
|
||||
else
|
||||
currentTool()->hoverMoveEvent(removeLayerItems(items(event->scenePos())), event);
|
||||
static QTime time;
|
||||
|
||||
event->accept();
|
||||
if (time.elapsed() > 30) {
|
||||
time.restart();
|
||||
if (event->buttons())
|
||||
currentTool()->mouseMoveEvent(removeLayerItems(items(event->scenePos())), event);
|
||||
else
|
||||
currentTool()->hoverMoveEvent(removeLayerItems(items(event->scenePos())), event);
|
||||
|
||||
event->accept();
|
||||
}
|
||||
}
|
||||
|
||||
void FormEditorScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
|
||||
Reference in New Issue
Block a user