examples/script/helloscript/main.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    66     QScriptValue scriptButton = engine.newQObject(&button);
    66     QScriptValue scriptButton = engine.newQObject(&button);
    67     engine.globalObject().setProperty("button", scriptButton);
    67     engine.globalObject().setProperty("button", scriptButton);
    68 //! [2]
    68 //! [2]
    69 
    69 
    70 //! [3]
    70 //! [3]
    71     QString fileName(":/helloscript.qs");
    71     QString fileName(":/helloscript.js");
    72     QFile scriptFile(fileName);
    72     QFile scriptFile(fileName);
    73     scriptFile.open(QIODevice::ReadOnly);
    73     scriptFile.open(QIODevice::ReadOnly);
    74     QTextStream stream(&scriptFile);
    74     QTextStream stream(&scriptFile);
    75     QString contents = stream.readAll();
    75     QString contents = stream.readAll();
    76     scriptFile.close();
    76     scriptFile.close();