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

Data type conversions between C++ and JavaScript

Qt will automatically convert arguments and return types of methods to its JavaScript counterparts. The supported conversions include the following:

  • Basic types (bool, int, double, and such) are exposed without changes
  • Qt data types (QString, QUrl, QColor, QFont, QDate, QPoint, QSize, QRect, QMatrix4x4, QQuaternion, QVector2D, and such) are converted to objects with the available properties
  • QDateTime and QTime values are automatically converted to JavaScript Date objects
  • Enums declared with Q_ENUM macro can be used in JavaScript
  • Flags declared with Q_FLAG macro can be used as flags in JavaScript
  • QObject* pointers will be automatically converted to JavaScript wrapper objects
  • QVariant objects ...

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