Pop quiz
Q1. Which is the method that you can use to execute JavaScript code?
QJSValue::call()QJSEngine::evaluate()QJSEngine::fromScriptValue()
Q2. What is the name of the class that serves as a bridge to exchange data between JS engine and C++?
QObjectQJSValueQVariant
Q3. If you want to expose a C++ object to the script, which class must this object be derived from?
QObjectQJSValueQGraphicsItem
Q4. Which of the following kinds of functions is not available to JavaScript code?
- Signals
Q_INVOKABLEmethods- Slots
- Global functions
Q5. When is a PyObject instance destroyed?
- When its value is set to
Py_None - When its internal reference counter drops to 0
- When the corresponding
QtPythonValueis destroyed