Hi there!

How can I call the native event handler when using the scriptshell binding of the qt script binding generator?

I'm using the splendid qt script binding generator lab-project to make all qt classes fully scriptable. Through the scriptshells it allows binding a script function to otherwise inaccessible protected event handlers. In non script you would derive from the class to access these..

Qt Code:
  1. scriptcode:
  2.  
  3. var a = new QWidget();
  4. a.setGeometry(50,50,200,100);
  5. a.show();
  6. a.event = function (event) {
  7. print(event.type().toString());
  8. };
To copy to clipboard, switch view to plain text mode 

This works perfectly, but it hides the native implementation. If you look into the generated scriptshell files of the generator:

Qt Code:
  1. from: ..\com_trolltech_qt_gui\qtscriptshell_QWidget.cpp
  2.  
  3. bool QtScriptShell_QWidget::event(QEvent* arg__1)
  4. {
  5. QScriptValue _q_function = __qtscript_self.property("event");
  6. if (!_q_function.isFunction() || QTSCRIPT_IS_GENERATED_FUNCTION(_q_function)
  7. || (__qtscript_self.propertyFlags("event") & QScriptValue::QObjectMember)) {
  8. return QWidget::event(arg__1);
  9. } else {
  10. QScriptEngine *_q_engine = __qtscript_self.engine();
  11. return qscriptvalue_cast<bool >(_q_function.call(__qtscript_self,
  12. QScriptValueList()
  13. << qScriptValueFromValue(_q_engine, arg__1)));
  14. }
  15. }
To copy to clipboard, switch view to plain text mode 
So either the native or the script event handler is called. Now my question is, if I missed an obvious way to call the native event handler from script.

If thats not possible I'm thinking of changing the scriptshell-generator-code (..\generator\shellimplgenerator.cpp ) to call the native handler for all events that have not been accepted inside the script-method. That's easy enough, but I want to know, if there is an out-of-the-box way.

Thx!

Johannes