2020-04-27 17:36:17 +02:00
|
|
|
#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) :
|
2020-04-27 17:36:17 +02:00
|
|
|
QDialog(parent),
|
2020-04-27 19:51:46 +02:00
|
|
|
mUi(new Ui::FunctionContractDialog)
|
2020-04-27 17:36:17 +02:00
|
|
|
{
|
2020-04-27 19:51:46 +02:00
|
|
|
mUi->setupUi(this);
|
|
|
|
mUi->functionName->setText(formatFunctionName(name));
|
|
|
|
mUi->expects->setPlainText(expects);
|
2020-04-27 17:36:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
FunctionContractDialog::~FunctionContractDialog()
|
|
|
|
{
|
2020-04-27 19:51:46 +02:00
|
|
|
delete mUi;
|
2020-04-27 17:36:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
QString FunctionContractDialog::getExpects() const
|
|
|
|
{
|
2020-04-27 19:51:46 +02:00
|
|
|
return mUi->expects->toPlainText();
|
2020-04-27 17:36:17 +02:00
|
|
|
}
|
|
|
|
|