forked from qt-creator/qt-creator
Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline
This commit is contained in:
@@ -47,6 +47,11 @@ TypeOfExpression::TypeOfExpression():
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Snapshot TypeOfExpression::snapshot() const
|
||||||
|
{
|
||||||
|
return m_snapshot;
|
||||||
|
}
|
||||||
|
|
||||||
void TypeOfExpression::setSnapshot(const Snapshot &documents)
|
void TypeOfExpression::setSnapshot(const Snapshot &documents)
|
||||||
{
|
{
|
||||||
m_snapshot = documents;
|
m_snapshot = documents;
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ public:
|
|||||||
public:
|
public:
|
||||||
TypeOfExpression();
|
TypeOfExpression();
|
||||||
|
|
||||||
|
Snapshot snapshot() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the documents used to evaluate expressions. Should be set before
|
* Sets the documents used to evaluate expressions. Should be set before
|
||||||
* calling this functor.
|
* calling this functor.
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ namespace Internal {
|
|||||||
class FunctionArgumentWidget : public QLabel {
|
class FunctionArgumentWidget : public QLabel {
|
||||||
public:
|
public:
|
||||||
FunctionArgumentWidget(Core::ICore *core);
|
FunctionArgumentWidget(Core::ICore *core);
|
||||||
void showFunctionHint(Function *functionSymbol);
|
void showFunctionHint(Function *functionSymbol, const Snapshot &snapshot);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *obj, QEvent *e);
|
bool eventFilter(QObject *obj, QEvent *e);
|
||||||
@@ -94,6 +94,7 @@ private:
|
|||||||
|
|
||||||
QFrame *m_popupFrame;
|
QFrame *m_popupFrame;
|
||||||
Function *m_item;
|
Function *m_item;
|
||||||
|
Snapshot m_snapshot;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ConvertToCompletionItem: protected NameVisitor
|
class ConvertToCompletionItem: protected NameVisitor
|
||||||
@@ -212,9 +213,11 @@ FunctionArgumentWidget::FunctionArgumentWidget(Core::ICore *core)
|
|||||||
setMargin(1);
|
setMargin(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FunctionArgumentWidget::showFunctionHint(Function *functionSymbol)
|
void FunctionArgumentWidget::showFunctionHint(Function *functionSymbol,
|
||||||
|
const Snapshot &snapshot)
|
||||||
{
|
{
|
||||||
m_item = functionSymbol;
|
m_item = functionSymbol;
|
||||||
|
m_snapshot = snapshot;
|
||||||
m_startpos = m_editor->position();
|
m_startpos = m_editor->position();
|
||||||
|
|
||||||
// update the text
|
// update the text
|
||||||
@@ -1023,7 +1026,7 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
|
|||||||
QTC_ASSERT(function, return);
|
QTC_ASSERT(function, return);
|
||||||
|
|
||||||
m_functionArgumentWidget = new FunctionArgumentWidget(m_core);
|
m_functionArgumentWidget = new FunctionArgumentWidget(m_core);
|
||||||
m_functionArgumentWidget->showFunctionHint(function);
|
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) {
|
||||||
QString toInsert = item.m_text;
|
QString toInsert = item.m_text;
|
||||||
|
|||||||
Reference in New Issue
Block a user