aboutsummaryrefslogtreecommitdiffstats
path: root/PySide
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-08-26 15:39:29 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:48 -0300
commite9b959ed8ef5bab7840220675c327f6b0ffc3204 (patch)
tree4d53783791ba6328f6822b5923d16ad707cae479 /PySide
parentd5b645d3ab8faa5aa5887e7fecf370f7ef322bba (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')
-rw-r--r--PySide/QtCore/typesystem_core.xml1
-rw-r--r--PySide/QtWebKit/typesystem_webkit.xml21
2 files changed, 21 insertions, 1 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 6889b2e26..124b4cd53 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -62,7 +62,6 @@
<rejection class="*" function-name="tr" />
<rejection class="*" function-name="trUtf8" />
<rejection class="*" function-name="qt_metacast" />
- <rejection class="*" function-name="qt_metacall" />
<!-- From Qt4.6 -->
<rejection class="*" field-name="d_ptr"/>
<rejection class="*" field-name="staticQtMetaObject"/>
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"/>