Commit ac7f17c2 authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: Don't use a timer anymore in the drag tool



Change-Id: I5f8b8436815c871e462c888e9963c8ee754bbc72
Reviewed-by: default avatarTim Jenssen <tim.jenssen@digia.com>
parent 1c15b4f3
......@@ -42,19 +42,11 @@
namespace QmlDesigner {
namespace Internal {
void TimerHandler::clearMoveDelay()
{
m_dragTool->clearMoveDelay();
}
}
DragTool::DragTool(FormEditorView *editorView)
: AbstractFormEditorTool(editorView),
m_moveManipulator(editorView->scene()->manipulatorLayerItem(), editorView),
m_selectionIndicator(editorView->scene()->manipulatorLayerItem()),
m_timerHandler(new Internal::TimerHandler(this)),
m_blockMove(false),
m_isAborted(false)
{
......@@ -327,7 +319,6 @@ void DragTool::createDragNode(const QMimeData *mimeData, const QPointF &scenePos
m_blockMove = true;
m_startPoint = scenePosition;
QTimer::singleShot(10000, m_timerHandler.data(), SLOT(clearMoveDelay()));
}
}
}
......
......@@ -42,22 +42,6 @@ namespace QmlDesigner {
class DragTool;
namespace Internal {
class TimerHandler : public QObject
{
Q_OBJECT
public:
TimerHandler(DragTool *tool) : QObject(), m_dragTool(tool) {}
public slots:
void clearMoveDelay();
private:
DragTool *m_dragTool;
};
}
class DragTool : public AbstractFormEditorTool
{
public:
......@@ -116,7 +100,6 @@ private:
QPointer<FormEditorItem> m_movingItem;
RewriterTransaction m_rewriterTransaction;
QmlItemNode m_dragNode;
QScopedPointer<Internal::TimerHandler> m_timerHandler;
bool m_blockMove;
QPointF m_startPoint;
bool m_isAborted;
......
......@@ -299,6 +299,12 @@ void FormEditorView::propertiesRemoved(const QList<AbstractProperty> &/*property
{
}
void FormEditorView::customNotification(const AbstractView */*view*/, const QString &identifier, const QList<ModelNode> &/*nodeList*/, const QList<QVariant> &/*data*/)
{
if (identifier == QStringLiteral("puppet crashed"))
m_dragTool->clearMoveDelay();
}
AbstractFormEditorTool* FormEditorView::currentTool() const
{
return m_currentTool;
......
......@@ -84,6 +84,8 @@ public:
void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList) QTC_OVERRIDE;
void propertiesRemoved(const QList<AbstractProperty> &propertyList) QTC_OVERRIDE;
void customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data) QTC_OVERRIDE;
// FormEditorView
WidgetInfo widgetInfo() QTC_OVERRIDE;
......
......@@ -188,6 +188,8 @@ void NodeInstanceView::handleChrash()
restartProcess();
else
emit qmlPuppetCrashed();
emitCustomNotification(QStringLiteral("puppet crashed"));
}
......
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