Fix QShortcut inject code.
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
This commit is contained in:
parent
8360149dad
commit
3b41e70376
1 changed files with 7 additions and 8 deletions
|
|
@ -1535,17 +1535,16 @@
|
||||||
</object-type>
|
</object-type>
|
||||||
|
|
||||||
<object-type name="QShortcut">
|
<object-type name="QShortcut">
|
||||||
<add-function signature="QShortcut(const QKeySequence&, QWidget*, PyObject*, Qt::ShortcutContext)">
|
<add-function signature="QShortcut(const QKeySequence&, QWidget*, PyCallable*, Qt::ShortcutContext)">
|
||||||
<modify-argument index="4">
|
<modify-argument index="4">
|
||||||
<replace-default-expression with="Qt::WindowShortcut"/>
|
<replace-default-expression with="Qt::WindowShortcut"/>
|
||||||
</modify-argument>
|
</modify-argument>
|
||||||
<inject-code class="target" position="beginning">
|
<inject-code class="target" position="beginning">
|
||||||
cptr = new QShortcutWrapper(%1, %2);
|
%0 = new %TYPE(%1, %2);
|
||||||
PyObject* result = PyObject_CallMethod(%PYSELF, "connect", "OsO", %PYSELF, SIGNAL(activated()), %PYARG_3);
|
</inject-code>
|
||||||
if (result == 0) {
|
<inject-code class="target" position="end">
|
||||||
delete cptr;
|
Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, "connect", "OsO", %PYSELF, SIGNAL(activated()), %PYARG_3));
|
||||||
return 0;
|
if (!result.isNull())
|
||||||
}
|
|
||||||
Shiboken::setParent(%PYARG_2, %PYSELF);
|
Shiboken::setParent(%PYARG_2, %PYSELF);
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</add-function>
|
</add-function>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue