forked from qt-creator/qt-creator
QmlDesigner: Don't use a timer anymore in the drag tool
Change-Id: I5f8b8436815c871e462c888e9963c8ee754bbc72 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
This commit is contained in:
@@ -42,19 +42,11 @@
|
|||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
namespace Internal {
|
|
||||||
void TimerHandler::clearMoveDelay()
|
|
||||||
{
|
|
||||||
m_dragTool->clearMoveDelay();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
DragTool::DragTool(FormEditorView *editorView)
|
DragTool::DragTool(FormEditorView *editorView)
|
||||||
: AbstractFormEditorTool(editorView),
|
: AbstractFormEditorTool(editorView),
|
||||||
m_moveManipulator(editorView->scene()->manipulatorLayerItem(), editorView),
|
m_moveManipulator(editorView->scene()->manipulatorLayerItem(), editorView),
|
||||||
m_selectionIndicator(editorView->scene()->manipulatorLayerItem()),
|
m_selectionIndicator(editorView->scene()->manipulatorLayerItem()),
|
||||||
m_timerHandler(new Internal::TimerHandler(this)),
|
|
||||||
m_blockMove(false),
|
m_blockMove(false),
|
||||||
m_isAborted(false)
|
m_isAborted(false)
|
||||||
{
|
{
|
||||||
@@ -327,7 +319,6 @@ void DragTool::createDragNode(const QMimeData *mimeData, const QPointF &scenePos
|
|||||||
|
|
||||||
m_blockMove = true;
|
m_blockMove = true;
|
||||||
m_startPoint = scenePosition;
|
m_startPoint = scenePosition;
|
||||||
QTimer::singleShot(10000, m_timerHandler.data(), SLOT(clearMoveDelay()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -42,22 +42,6 @@ namespace QmlDesigner {
|
|||||||
|
|
||||||
class DragTool;
|
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
|
class DragTool : public AbstractFormEditorTool
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -116,7 +100,6 @@ private:
|
|||||||
QPointer<FormEditorItem> m_movingItem;
|
QPointer<FormEditorItem> m_movingItem;
|
||||||
RewriterTransaction m_rewriterTransaction;
|
RewriterTransaction m_rewriterTransaction;
|
||||||
QmlItemNode m_dragNode;
|
QmlItemNode m_dragNode;
|
||||||
QScopedPointer<Internal::TimerHandler> m_timerHandler;
|
|
||||||
bool m_blockMove;
|
bool m_blockMove;
|
||||||
QPointF m_startPoint;
|
QPointF m_startPoint;
|
||||||
bool m_isAborted;
|
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
|
AbstractFormEditorTool* FormEditorView::currentTool() const
|
||||||
{
|
{
|
||||||
return m_currentTool;
|
return m_currentTool;
|
||||||
|
@@ -84,6 +84,8 @@ public:
|
|||||||
void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList) QTC_OVERRIDE;
|
void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList) QTC_OVERRIDE;
|
||||||
void propertiesRemoved(const QList<AbstractProperty> &propertyList) 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
|
// FormEditorView
|
||||||
WidgetInfo widgetInfo() QTC_OVERRIDE;
|
WidgetInfo widgetInfo() QTC_OVERRIDE;
|
||||||
|
|
||||||
|
@@ -188,6 +188,8 @@ void NodeInstanceView::handleChrash()
|
|||||||
restartProcess();
|
restartProcess();
|
||||||
else
|
else
|
||||||
emit qmlPuppetCrashed();
|
emit qmlPuppetCrashed();
|
||||||
|
|
||||||
|
emitCustomNotification(QStringLiteral("puppet crashed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user