PDA

View Full Version : QSA 1.2.1 && MessageBox



xk
20th April 2006, 17:30
I have this code:


QApplication app(argc, argv);

QString fileName = "test-script.qs";
QFile file(fileName);
if(file.open(QIODevice::ReadOnly) == 0)
return 1;

QString scriptCode(file.readAll());

CReport *report = new CReport;
CReportWrapper *reportWrapper = new CReportWrapper(report);
reportWrapper->setObjectName("reportWrapper1");

QSInterpreter ip;
ip.addWrapperFactory(new CWrappers());
ip.addTransientObject(reportWrapper);
ip.evaluate(scriptCode, 0, fileName);
ip.call("mytest");


and test-script.qs consist of:


function mytest()
{
MessageBox.warning("This is test", MessageBox.Yes, MessageBox.No);
Application.reportWrapper1.setPing(666);
}


And i have error message: "Error. Use of undefined variable 'MessageBox'" :confused: