diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-08-26 15:39:29 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:54:48 -0300 |
commit | e9b959ed8ef5bab7840220675c327f6b0ffc3204 (patch) | |
tree | 4d53783791ba6328f6822b5923d16ad707cae479 /PySide/QtWebKit | |
parent | d5b645d3ab8faa5aa5887e7fecf370f7ef322bba (diff) |
Implemented inject code for function QWebPage.qt_metacall.
This inject code is necessary due a workaround on C++ class QWebPage.
Check de C++ doc for more information:
http://doc.qt.nokia.com/4.7-snapshot/qwebpage.html#shouldInterruptJavaScript
Fixes bug #973.
Reviewed by: Hugo Parente <hugo.lima@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'PySide/QtWebKit')
-rw-r--r-- | PySide/QtWebKit/typesystem_webkit.xml | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/PySide/QtWebKit/typesystem_webkit.xml b/PySide/QtWebKit/typesystem_webkit.xml index bd32ccc49..5dbd449fa 100644 --- a/PySide/QtWebKit/typesystem_webkit.xml +++ b/PySide/QtWebKit/typesystem_webkit.xml @@ -163,6 +163,27 @@ </conversion-rule> </modify-argument> </modify-function> + + <add-function signature="qt_metacall()"> + <inject-code class="native"> + static int _signalIndex = -1; + static QMetaMethod _m; + + if (_signalIndex == -1) { + _signalIndex = QWebPage::staticMetaObject.indexOfSlot("shouldInterruptJavaScript()"); + _m = QWebPage::staticMetaObject.method(_signalIndex); + } + + if (_signalIndex == id) { + Shiboken::GilState gil; + PyObject* self = (PyObject*)Shiboken::BindingManager::instance().retrieveWrapper(this); + if (self) { + Shiboken::AutoDecRef _pyMethod(PyObject_GetAttrString(self, "shouldInterruptJavaScript")); + return PySide::SignalManager::callPythonMetaMethod(_m, args, _pyMethod, false); + } + } + </inject-code> + </add-function> </object-type> <object-type name="QWebHistory"/> <object-type name="QWebHistoryInterface"/> |