Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
None
-
None
-
None
-
b242e46f6f (pyside/pyside-setup/dev) b242e46f6f (pyside/tqtc-pyside-setup/dev)
Description
Hello,
normal shiboken behavior which wraps all functions / variables of a <object-type> / <value-type> unless some function / field is either rejected / removed is good for libraries which 'aims' to wrap all the functionality and expose to the end users.
This behavior however is a little bit problematic when it comes to applications which exposes some portions of the API (scriptable app style).
In our case we have classes that we wrap almost whole and we have classes that we expose in a minimal manner (few functions out of many) - which requires us to write a lot of code in the xml (remove funcs to not be wrapped) - it also creates problem with maintainability - as every change (when we add some internal stuff) - needs to be added to the remove list.
Of course i understand that we could adapt style that qt uses - e.g. private class of every public class which hides that functionality.
In our case the app wasn't built with public python API in mind - it was added later on.
what i am proposing is:
- add to <object-type> / <value-type> option "export all = 'yes | no'"
- by default it would be yes (to be backward compatible)
- if it's "yes" then it works the same as now - wrap everything unless told not to.
- if it's "no" then it would only wrap functions that are specified in a list.
- for a "no" to work <modify-function> tag would need new option "wrap = 'yes | no'"
- when a function is specified as wrap="yes" it would 'export' that function to python.
this would ease maintainability and would allow to write less xml - for classes that export almost all functions its easier to remove few and for classes that export few functions its easier to add to wrap list few functions.
Also it would be defined by each <object-type>, <value-type> so its very flexible.
Attachments
For Gerrit Dashboard: PYSIDE-1764 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
400464,10 | shiboken6: Add an attribute for explicitly defining the functions to be generated | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |