PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 362 - Added function signature types should recognize added Python types
: Added function signature types should recognize added Python types
Status: CLOSED WONTFIX
Product: PySide
Classification: Unclassified
Component: Shiboken
: HEAD
: All All
: P4 enhancement
Assigned To: Marcelo Lira
:
:
:
  Show dependency treegraph
 
Reported: 2010-09-16 12:05 EEST by Marcelo Lira
Modified: 2011-08-23 00:37 EEST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcelo Lira 2010-09-16 12:05:27 EEST
The "signature" attribute of the "add-function" usually get C++ types for the
function arguments, example:

<add-function signature="foo(int, ClassA*)"...>

with "ClassA" being a wrapped class declared in some type system file. The
types declared are recognized by the generator and are used to produce code
for:

* type checking
* type conversion
* the method overload decisor

When a Python object is an argument this form is used:

<add-function signature="foo(PyObject*)" ...>

PyObject* can be anything from Python. Normally it works fine, but there are
cases when a specific Python object provided by the binding developer must be
used.

Practical example: PySide.QtCore.Signal, provided by libpyside.

This will not work:

<add-function signature="foo(PySide.QtCore.Signal)" ...>

neither this (using the C++ name "PySide::SignalInstanceData"):

<add-function signature="foo(PySide::SignalInstanceData*)" ...>

So the code injection for this new method signature will have to deal with type
checking (see if the provided PyObject is PySide::SignalInstanceData) and
emitting the exception if needed (remember that the generator can do this with
the types he already knows), and also writing a proper exception message.

For the last item an example where the first argument is expected to be
PySide.QtCore.Signal, but the current limitations allow only for PyObject to be
used in the signature:

TypeError: 'PySide.QtCore.QState.addTransition' called with wrong argument
types:
  PySide.QtCore.QState.addTransition(str, PySide.QtCore.QState)
Supported signatures:
  PySide.QtCore.QState.addTransition(PyObject, PySide.QtCore.QAbstractState)
  ...

A proper supported signature string would be:
Supported signatures:
  PySide.QtCore.QState.addTransition(PySide.QtCore.Signal,
PySide.QtCore.QAbstractState)
  ...
Comment 1 Marcelo Lira 2010-09-16 14:28:12 EEST
The fix for bug #348[1] (commit PySide/c0611016) must be updated to fit any
solution provided by the fix of the current bug.

[1] http://bugs.openbossa.org/show_bug.cgi?id=348
Comment 2 Marcelo Lira 2010-09-17 08:57:19 EEST
The fix for bug #313[1] (commit PySide/75b44379) must be updated to fit any
solution provided by the fix of the current bug.

[1] http://bugs.openbossa.org/show_bug.cgi?id=313
Comment 3 Matti Airas 2010-11-30 06:09:15 EET
This was deemed post-1.0. Reprioritizing to P4 for now.
Comment 4 Luciano Wolf 2011-07-29 17:13:51 EEST
After some discussion with Renato, Hugo and Marcelo they decided to close the
bug. It's a feature too complex that doesn't worth implementing.
Comment 5 renato filho 2011-08-23 00:37:21 EEST
Release PySide 1.0.6