summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukáš Lalinský <lalinsky@gmail.com>2009-11-01 20:21:27 +0100
committerLukáš Lalinský <lalinsky@gmail.com>2009-11-01 20:21:27 +0100
commit5b2d6ba0bf0a9605201fe19a9e3250938f71eb3c (patch)
treef23c83415eb0fe361b3e23231d3a6eea962ece30
parent573b027e72bfeda604f3585851df38373c52447a (diff)
downloaddbmodel-5b2d6ba0bf0a9605201fe19a9e3250938f71eb3c.tar.gz
dbmodel-5b2d6ba0bf0a9605201fe19a9e3250938f71eb3c.tar.bz2
Reset the update time to the default interval after using updatePositions(force=true)
-rw-r--r--src/diagramdocument.cpp11
1 files 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