Skip to content

Instantly share code, notes, and snippets.

Created June 7, 2009 20:57
Show Gist options
  • Select an option

  • Save anonymous/125487 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/125487 to your computer and use it in GitHub Desktop.
// example: QS_BIND_MODULE(new QScriptEngine, core)
#define QS_BIND_MODULE(engine, modulename) \
extern void qtscript_initialize_com_trolltech_qt_##modulename##_bindings(QScriptValue &extensionObject); \
{ QScriptValue extensionObject = (engine)->globalObject(); \
qtscript_initialize_com_trolltech_qt_##modulename##_bindings(extensionObject); }
// example: QS_BIND_CLASS(new QScriptEngine, QPushButton)
#define QS_BIND_CLASS(engine, classname) \
extern QScriptValue qtscript_create_##classname##_class(QScriptEngine*); \
(engine)->globalObject().setProperty(#classname, \
qtscript_create_##classname##_class((engine)), \
QScriptValue::SkipInEnumeration);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment