forked from qt-creator/qt-creator
Reuse the function argument widget when possible
Now that we're showing this thing instantly, we can no longer rely on the thing hiding cause of a focus change.
This commit is contained in:
@@ -187,10 +187,10 @@ using namespace CppTools::Internal;
|
|||||||
FunctionArgumentWidget::FunctionArgumentWidget()
|
FunctionArgumentWidget::FunctionArgumentWidget()
|
||||||
: m_item(0)
|
: m_item(0)
|
||||||
{
|
{
|
||||||
QObject *editorObject = Core::ICore::instance()->editorManager()->currentEditor();
|
QObject *editorObject = Core::EditorManager::instance()->currentEditor();
|
||||||
m_editor = qobject_cast<TextEditor::ITextEditor *>(editorObject);
|
m_editor = qobject_cast<TextEditor::ITextEditor *>(editorObject);
|
||||||
|
|
||||||
m_popupFrame = new QFrame(0, Qt::ToolTip|Qt::WindowStaysOnTopHint);
|
m_popupFrame = new QFrame(0, Qt::ToolTip | Qt::WindowStaysOnTopHint);
|
||||||
m_popupFrame->setFocusPolicy(Qt::NoFocus);
|
m_popupFrame->setFocusPolicy(Qt::NoFocus);
|
||||||
m_popupFrame->setAttribute(Qt::WA_DeleteOnClose);
|
m_popupFrame->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
@@ -1069,7 +1069,10 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
|
|||||||
Function *function = symbol->type()->asFunctionType();
|
Function *function = symbol->type()->asFunctionType();
|
||||||
QTC_ASSERT(function, return);
|
QTC_ASSERT(function, return);
|
||||||
|
|
||||||
m_functionArgumentWidget = new FunctionArgumentWidget();
|
// Recreate if necessary
|
||||||
|
if (!m_functionArgumentWidget)
|
||||||
|
m_functionArgumentWidget = new FunctionArgumentWidget;
|
||||||
|
|
||||||
m_functionArgumentWidget->showFunctionHint(function, typeOfExpression.snapshot());
|
m_functionArgumentWidget->showFunctionHint(function, typeOfExpression.snapshot());
|
||||||
}
|
}
|
||||||
} else if (m_completionOperator == T_SIGNAL || m_completionOperator == T_SLOT) {
|
} else if (m_completionOperator == T_SIGNAL || m_completionOperator == T_SLOT) {
|
||||||
|
Reference in New Issue
Block a user