From 5b2d6ba0bf0a9605201fe19a9e3250938f71eb3c Mon Sep 17 00:00:00 2001 From: Lukáš Lalinský Date: Sun, 1 Nov 2009 20:21:27 +0100 Subject: Reset the update time to the default interval after using updatePositions(force=true) --- src/diagramdocument.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/diagramdocument.cpp b/src/diagramdocument.cpp index a541d7a..a1aad5d 100644 --- a/src/diagramdocument.cpp +++ b/src/diagramdocument.cpp @@ -63,13 +63,15 @@ public: Diagram::LineLayouter *lineLayouter; }; +static const int UPDATE_DELAY = 2; + DiagramDocument::DiagramDocument(QObject *parent) : QGraphicsScene(parent), d(new DiagramDocumentPrivate), m_mode(DiagramDocument::Select), m_line(NULL) { m_undoStack = new QUndoStack(this); d->updateTimer = new QTimer(); d->updateTimer->setSingleShot(true); - d->updateTimer->setInterval(10); + d->updateTimer->setInterval(UPDATE_DELAY); connect(d->updateTimer, SIGNAL(timeout()), this, SLOT(_updateLines())); } @@ -160,10 +162,13 @@ void DiagramDocument::updatePositions(DiagramObject *object, bool force) { d->objectsToUpdate.insert(object); - if (force) + if (force) { d->updateTimer->start(0); - else + d->updateTimer->setInterval(UPDATE_DELAY); + } + else { d->updateTimer->start(); + } } void -- cgit v1.2.3-54-g00ecf