cppcheck/gui/functioncontractdialog.cpp

32 lines
713 B
C++
Raw Normal View History

#include "functioncontractdialog.h"
#include "ui_functioncontractdialog.h"
static QString formatFunctionName(QString f)
{
if (f.endsWith("()"))
return f;
f.replace("(", "(\n ");
f.replace(",", ",\n ");
return f;
}
2020-04-27 19:51:46 +02:00
FunctionContractDialog::FunctionContractDialog(QWidget *parent, const QString &name, const QString &expects) :
QDialog(parent),
2020-04-27 19:51:46 +02:00
mUi(new Ui::FunctionContractDialog)
{
2020-04-27 19:51:46 +02:00
mUi->setupUi(this);
mUi->functionName->setText(formatFunctionName(name));
mUi->expects->setPlainText(expects);
}
FunctionContractDialog::~FunctionContractDialog()
{
2020-04-27 19:51:46 +02:00
delete mUi;
}
QString FunctionContractDialog::getExpects() const
{
2020-04-27 19:51:46 +02:00
return mUi->expects->toPlainText();
}