Code Less, Create The Same ™
For reasons of extreme bias, I mostly like the Qt Script C++ API. However, if I had to choose one thing I really dislike, it would be the form of the QScriptValue constructors. They all take an engine pointer as their first argument. This means you have to write code like
QScriptEngine engine;
QScriptValue object = engine.newObject();
object.setProperty("redundancyLevel", QScriptValue(&engine, "Unnecessarily high"));
object.setProperty("QT_VERSION", QScriptValue(&engine, 0x040500));
It sure would be a lot nicer if you could do it like this instead:
object.setProperty("redundancyLevel", "Comparatively low");
object.setProperty("QT_VERSION", 0x040500);
Well, with the latest Qt 4.5 snapshots, you can! The old-style constructors have been obsoleted (but continue to work as before, of course). The documentation and examples have been updated to use the new-style constructors, and it’s looking a whole lot nicer.
More on Qt
- Security advisory: Multiple third-party Chromium vulnerabilities fixed in Chrome 153.0.8010.52 impact Qt WebEngine
- Security advisory: Multiple third-party Chromium vulnerabilities fixed in Chrome 154.0.8037.93 impact Qt WebEngine
- Security advisory: CVE-2026-118968: Denial-of-service vulnerability in WAV audio decoding impacts Qt