//
// Author : Anthony Geay (EDF R&D)
+#include "Python.h"
#include "YDFXGUISeqInit.hxx"
#include <QFile>
#include <QFileDialog>
#include <QApplication>
-#include "Python.h"
#include "AutoGIL.hxx"
//
if(_fileName.isEmpty())
{
- emit problemDetected(QString("For \"%1\" : no file defined !").arg(zeBossc->getName()));
+ Q_EMIT problemDetected(QString("For \"%1\" : no file defined !").arg(zeBossc->getName()));
return false;
}
QFile file(_fileName);
double v(line2.toDouble(&isOK));
if(!isOK)
{
- emit problemDetected(QString("For \"%1\" : At line %2 it is not a float !").arg(zeBossc->getName()).arg(i));
+ Q_EMIT problemDetected(QString("For \"%1\" : At line %2 it is not a float !").arg(zeBossc->getName()).arg(i));
return false;
}
_vect.push_back(v);
AutoPyRef code(Py_CompileString(txt.c_str(),TMP_FILENAME, Py_file_input));
if(code.get() == NULL)
{
- emit problemDetected(QString("For \"%1\" : python code is invalid !").arg(zeBossc->getName()));
+ Q_EMIT problemDetected(QString("For \"%1\" : python code is invalid !").arg(zeBossc->getName()));
return false;
}
AutoPyRef context(PyDict_New());
PyDict_SetItemString( context, "__builtins__", PyEval_GetBuiltins() );
- AutoPyRef res(PyEval_EvalCode((PyCodeObject *)code.get(), context, context));
+ AutoPyRef res(PyEval_EvalCode(code.get(), context, context));
PyObject *item(PyDict_GetItemString(context,name.c_str()));
//
if(!item)
{
- emit problemDetected(QString("For \"%1\" : Py var %1 is not defined !").arg(zeBossc->getName()));
+ Q_EMIT problemDetected(QString("For \"%1\" : Py var %1 is not defined !").arg(zeBossc->getName()));
return false;
}
if(!PyList_Check(item))
{
- emit problemDetected(QString("For \"%1\" : Py var %1 must be a list !").arg(zeBossc->getName()));
+ Q_EMIT problemDetected(QString("For \"%1\" : Py var %1 must be a list !").arg(zeBossc->getName()));
return false;
}
sz=PyList_Size(item);
PyObject *val(PyList_GetItem(item,i));
if(!PyFloat_Check(val))
{
- emit problemDetected(QString("For \"%1\" : At pos %2 of python list, it is not a float !").arg(zeBossc->getName()).arg(i));
+ Q_EMIT problemDetected(QString("For \"%1\" : At pos %2 of python list, it is not a float !").arg(zeBossc->getName()).arg(i));
return false;
}
_vect[i]=PyFloat_AS_DOUBLE(val);
connect(_combo,SIGNAL(currentIndexChanged(int)),this,SLOT(typeOfAssignmentChanged(int)));
horizontalLayout->addWidget(_setter);
_combo->setCurrentIndex(0);
- emit _combo->currentIndexChanged(0);//to be sure to sync widgets
+ Q_EMIT _combo->currentIndexChanged(0);//to be sure to sync widgets
}
void YDFXGUISeqLine::loadState(const QMap<QString,QString>& state)
{
int sz;
bool verdict(checkConsistency(sz));
- emit configurationIsOK(verdict);
+ Q_EMIT configurationIsOK(verdict);
}
void YDFXGUISeqInitEff::applyOnEFX()
refSz=locSz;
if(locSz!=refSz)
{
- emit line->setter()->problemDetected(QString("Var %1 does not have the same number of elts than others !").arg(line->getName()));
+ Q_EMIT line->setter()->problemDetected(QString("Var %1 does not have the same number of elts than others !").arg(line->getName()));
return false;
}
}