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:
Marco Bubke
2011-07-26 19:34:56 +02:00
parent 33c96800f0
commit ef5d054d0c

View File

@@ -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)