99 QString str = fFunctionInput_lineEdit->text();
107 if (!str.trimmed().startsWith(
"fun")) {
108 QMessageBox::critical(
this,
"addFunction",
109 "a function has to start with 'funX' (X a number).\nNeeds to be fixed.",
110 QMessageBox::Ok, QMessageBox::NoButton);
115 if (str.indexOf( QRegularExpression(
"fun\\d+\\s*=") ) == -1) {
116 QMessageBox::critical(
this,
"addFunction",
117 "a function has to start with 'funX =' (X a positive number).\nNeeds to be fixed.",
118 QMessageBox::Ok, QMessageBox::NoButton);
123 if (str.trimmed().lastIndexOf(
"fun", -1, Qt::CaseInsensitive) > 0) {
124 QMessageBox::critical(
this,
"addFunction",
125 "a function cannot contain more than one function,\ni.e. fun2 = fun1 + par1 is not OK.",
126 QMessageBox::Ok, QMessageBox::NoButton);
131 fFunctionBlock_plainTextEdit->appendPlainText(str);
134 fFunctionInput_lineEdit->clear();