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

Have a go hero – Wrapping Qt objects into Python objects

At this point, you should be experienced enough to try and implement a wrapper for the QObject instances to expose signals and slots to Python scripting. If you decide to pursue the goal, https://docs.python.org/3/ will be your best friend, especially the section about extending Python with C++. Remember that QMetaObject provides information about the properties and methods of Qt objects and QMetaObject::invokeMethod() allows you to execute a method by its name. This is not an easy task, so don't be hard on yourself if you are not able to complete it. You can always return to it once you gain more experience in using Qt and Python.

Before you head on to the next chapter, try testing ...

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