Skip to content
Snippets Groups Projects
Commit f7d46445 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Mark the current argument.

parent 38d642c0
No related branches found
No related tags found
No related merge requests found
......@@ -362,7 +362,13 @@ bool Struct::isLessThan(const Type *other) const
return false;
}
QString Function::toString() const
{
return prettyPrint(-1);
}
QString Function::prettyPrint(int currentArgument) const
{
QString proto;
proto += _returnType->toString();
......@@ -372,10 +378,14 @@ QString Function::toString() const
for (int i = 0; i < _arguments.size(); ++i) {
if (i != 0)
proto += QLatin1String(", ");
if (currentArgument == i)
proto += QLatin1String("<b>");
Argument *arg = _arguments.at(i);
proto += arg->type()->toString();
proto += QLatin1Char(' ');
proto += arg->name();
if (currentArgument == i)
proto += QLatin1String("</b>");
}
proto += QLatin1Char(')');
return proto;
......
......@@ -225,6 +225,7 @@ public:
Argument *argumentAt(int index) const;
// as Type
QString prettyPrint(int currentArgument) const;
virtual QString toString() const;
virtual const Function *asFunctionType() const { return this; }
virtual bool isEqualTo(const Type *other) const;
......
......@@ -469,7 +469,7 @@ bool FunctionArgumentWidget::eventFilter(QObject *obj, QEvent *e)
void FunctionArgumentWidget::updateHintText()
{
setText(currentFunction()->toString());
setText(currentFunction()->prettyPrint(m_currentarg));
m_numberLabel->setText(tr("%1 of %2").arg(m_current + 1).arg(m_items.size()));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment