O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Pop quiz

Q1. Which is the method that you can use to execute JavaScript code?

  1. QJSValue::call()
  2. QJSEngine::evaluate()
  3. QJSEngine::fromScriptValue()

Q2. What is the name of the class that serves as a bridge to exchange data between JS engine and C++?

  1. QObject
  2. QJSValue
  3. QVariant

Q3. If you want to expose a C++ object to the script, which class must this object be derived from?

  1. QObject
  2. QJSValue
  3. QGraphicsItem

Q4. Which of the following kinds of functions is not available to JavaScript code?

  1. Signals
  2. Q_INVOKABLE methods
  3. Slots
  4. Global functions

Q5. When is a PyObject instance destroyed?

  1. When its value is set to Py_None
  2. When its internal reference counter drops to 0
  3. When the corresponding QtPythonValue is destroyed

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required