QmlJSEditor: add shortcut for Qt Quick Helper (ctrl+alt+space)

This shortcut forces the Qt Quick Helper to be shown if
available. The action is also registered in the context menu
so it is discoverable.


Reviewed-by: Christian Kamm
This commit is contained in:
Thomas Hartmann
2010-08-04 13:50:15 +02:00
parent 70f605065f
commit b193b3598f
5 changed files with 27 additions and 2 deletions

View File

@@ -1338,6 +1338,15 @@ void QmlJSTextEditor::followSymbolUnderCursor()
openLink(findLinkAt(textCursor()));
}
void QmlJSTextEditor::showContextPane()
{
if (m_contextPane) {
Node *newNode = m_semanticInfo.declaringMemberNoProperties(position());
m_contextPane->apply(editableInterface(), m_semanticInfo.document, m_semanticInfo.snapshot, newNode, false, true);
m_oldCursorPosition = position();
}
}
void QmlJSTextEditor::contextMenuEvent(QContextMenuEvent *e)
{
QMenu *menu = new QMenu();
@@ -1654,8 +1663,6 @@ void QmlJSTextEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
void QmlJSTextEditor::onCursorPositionChanged()
{
if (m_contextPane) {
Node *newNode = m_semanticInfo.declaringMemberNoProperties(position());
Node *oldNode = m_semanticInfo.declaringMemberNoProperties(m_oldCursorPosition);