Commit 26ac5adc authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: Refactor QmlDesignerPlugin::selectModelNodeUnderTextCursor



Change-Id: I439d049bfc399252aee1865ea66c920859c88d2f
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent 41fe19cd
......@@ -289,10 +289,10 @@ void QmlDesignerPlugin::jumpTextCursorToSelectedModelNode()
void QmlDesignerPlugin::selectModelNodeUnderTextCursor()
{
const int cursorPos = currentDesignDocument()->plainTextEdit()->textCursor().position();
ModelNode node = currentDesignDocument()->rewriterView()->nodeAtTextCursorPosition(cursorPos);
if (currentDesignDocument()->rewriterView() && node.isValid())
currentDesignDocument()->rewriterView()->setSelectedModelNodes(QList<ModelNode>() << node);
const int cursorPosition = currentDesignDocument()->plainTextEdit()->textCursor().position();
ModelNode modelNode = currentDesignDocument()->rewriterView()->nodeAtTextCursorPosition(cursorPosition);
if (modelNode.isValid())
currentDesignDocument()->rewriterView()->setSelectedModelNode(modelNode);
}
void QmlDesignerPlugin::activateAutoSynchronization()
......
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