Commit 71df9a61 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.nodeInstanceView: further optimizes import changes

This patch delays the restart of the pupped by 200ms when an import changes.
parent 34846ac4
......@@ -41,6 +41,7 @@
#include <QSet>
#include <QWeakPointer>
#include <QRectF>
#include <QTimer>
QT_BEGIN_NAMESPACE
class QDeclarativeEngine;
......@@ -164,6 +165,7 @@ private: // functions
private slots:
void restartProcess();
void restartProcessDelayed();
private: //variables
NodeInstance m_rootNodeInstance;
......@@ -174,6 +176,7 @@ private: //variables
uint m_blockUpdates;
QWeakPointer<NodeInstanceServerInterface> m_nodeInstanceServer;
QTimer m_resetTimer;
};
} // namespace ProxyNodeInstanceView
......
......@@ -111,6 +111,9 @@ d too.
NodeInstanceView::NodeInstanceView(QObject *parent)
: AbstractView(parent)
{
m_resetTimer.setInterval(200);
m_resetTimer.setSingleShot(true);
connect(&m_resetTimer, SIGNAL(timeout()), this, SLOT(restartProcessDelayed()));
}
......@@ -170,6 +173,11 @@ void NodeInstanceView::restartProcess()
setBlockUpdates(false);
}
void NodeInstanceView::restartProcessDelayed()
{
m_resetTimer.start();
}
/*! \brief Notifing the view that a node was created.
A NodeInstance will be created for the new created ModelNode.
\param createdNode New created ModelNode.
......@@ -437,12 +445,12 @@ void NodeInstanceView::instancesCompleted(const QVector<ModelNode> &/*completedN
void NodeInstanceView::importAdded(const Import &import)
{
restartProcess();
restartProcessDelayed();
}
void NodeInstanceView::importRemoved(const Import &/*import*/)
{
restartProcess();
restartProcessDelayed();
}
//\}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment