| Summary: | Use API 2 for python plasma scriptengine | ||
|---|---|---|---|
| Product: | [Unmaintained] bindings | Reporter: | James Roe <roejames12> |
| Component: | pykde | Assignee: | bindings-bugs-null |
| Status: | RESOLVED UNMAINTAINED | ||
| Severity: | wishlist | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Ubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
An alternative method, is to (by default) use API 1 like normal, but allow user code to set a setting which says to use API 2 instead (similar to the way we can do it in sip, but more like a toggle). This way it's a backward compatible change, and won't kill so many widgets and programs. Hello, unfortunately this bug is being closed as unmaintained, per request of einar77. |
Version: unspecified (using KDE 4.7.2) OS: Linux PyQt4 has API 1 (default for Python 2), and API 2 (default for Python 3). But you can manually set the API in Python 2 to API 2, using something such as: import sip for item in ('QDate', 'QDateTime', 'QString', 'QTextStream', 'QTime' 'QUrl', 'QVariant'): sip.setapi(item, 2) Why is API 2 better? To put it short, API 2 converts Qt types to native Python types. It makes code seamless. For example, you wouldn't need to use QString anymore, just a regular python str. This of course applies to other types like lists, dicts, etc. Take a look at this PSEP which better describes the differences. http://www.pyside.org/docs/pseps/psep-0101.html Considering the nature of this request, it's probably best to do this for all KDE4 Python bindings as well, to keep things consistent. WARNING: This has the potential to break many widgets and programs which depend on PyKDE4! But this is really for the ultimate benefit of everyone however. :) Porting code form the old to the new style shouldn't be too hard either. Reproducible: Didn't try Steps to Reproduce: - Actual Results: - Expected Results: - -