QScriptEngine engine; QScriptValue obj = engine.newObject(); // create a prototype object QScriptValue proto = engine.newObject(); proto.setProperty("greet", engine.newFunction(helloWorld)); // set the prototype of the object obj.setPrototype(proto); // invoke a function from the prototype obj.property("greet").call();In this example, we create a new QScriptEngine object and a new QScriptValue object called "obj". We then create a prototype object called "proto" and define a function called "greet" on it. We use the setPrototype method to set the prototype of "obj" to "proto". Finally, we invoke the "greet" function on "obj" by retrieving it as a property from "obj" and then calling the "call" method on it. Package/library: Qt Script.