1
0
mirror of https://github.com/thp/pyotherside.git synced 2025-01-28 23:52:55 +08:00

137 Commits

Author SHA1 Message Date
Thomas Perl
160e3963ef PyOtherSide 1.5.0 1.5.0 2016-06-14 19:32:24 +02:00
Thomas Perl
066fbb5a51 Merge pull request #54 from xealits/importNames
Import names from module
2016-01-08 15:23:19 +01:00
Alex Toldaiev
8ad6d92bba importNames, import specific objects from a module to Python's global space
The importNames and importNames_sync adopt the protocol of importModule.

The importNames(module_name, [objects_names], callback) is asynchronous.
It calls the synchronous importNames_sync(module_name, [object_names]) via the signal import_names.

importNames_sync imports the module (with PyImport_ImportModule(moduleName)) and loops over the given names
trying to get the corresponding object from the module (by PyObject_GetAttrString).
On success the object is inserted into the global space of the Python interpreter.
(priv->globals.borrow() is the pointer to the corresponding Python dict.)
Each failed import separately emits the error message and continues to the next iteration.

 Changes to be committed:
	modified:   src/qpython.cpp
	modified:   src/qpython.h
	modified:   src/qpython_worker.cpp
	modified:   src/qpython_worker.h
2016-01-06 22:18:44 +00:00
Thomas Perl
4d3b4528b0 Merge pull request #58 from thp/qmltypes
Add qmltypes generated via qmlplugindump (Fixes #57)
2016-01-03 20:43:15 +01:00
Thomas Perl
dfa2cd0ab0 Add qmltypes generated via qmlplugindump (Fixes #57) 2016-01-03 11:34:08 +01:00
Thomas Perl
8a0352841c Merge pull request #56 from uglide/patch-2
Add support for QVariantHash
2015-12-16 09:26:47 +01:00
Igor Malinovskiy
74aac9e7e1 Add support for QVariantHash
Convert QVariantHash to python dict just like QVariantMap
2015-12-15 20:27:43 +02:00
Thomas Perl
371554ff79 Merge pull request #55 from uglide/patch-1
Add link to VS 2010 SP1 in documentation
2015-12-14 08:31:58 +01:00
Igor Malinovskiy
c581e4f700 Add link to VS 2010 SP1 in documentation
VS 2010 SP1 should be used to compile pyotherside on Windows, otherwise you will get error:
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
2015-12-11 09:11:31 -08:00
Thomas Perl
212c66567c Merge pull request #51 from M4rtinK/master-format_data_svg
Add support for rendering SVG data to the image provider
2015-10-28 08:20:08 +01:00
Martin Kolman
5ed00137d9 Handle sourceSize not being set
If sourceSize is not set at all, use defaultSize() as returned
by the QSvgRenderer instance.
If only width or height is set, get the other value from defaultSize()
and scale it according to the set one to keep aspect ratio of the image.
2015-10-28 01:57:55 +01:00
Martin Kolman
57a6699727 Add support for rendering SVG data to the image provider
The image provider can already render SVG images supplied
as format_data due to using QImage as backend.
This unfortunately only works correctly as long as the SVG image is
not scaled, as the image provider ignores the requested_size parameter
for format_data, causing the SVG image to be first rendered at its default size
and then scaled at the bitmap level, resulting in a very blurry image.

As there does not appear to be any easy fix for this when working with
the format_data type add a new data type called format_svg_data that
properly renders the SVG image at requested size with QtSvgRenderer.

Also the documentation has been updated to include format_svg_data
and an example has been added.
2015-10-28 01:51:08 +01:00
Thomas Perl
6d7f526c23 Call PyDateTime_IMPORT as often as necessary (Fixes #46)
In some cases (e.g. release builds, see issue #46) it could be
that pyobject_converter.h is included in more than one compile
unit, which also creates two instances of the PyDateTimeAPI
static variable, defined in Python's datetime.h. For this reason,
we must not keep track of the initialization state manually, but
instead just initialize PyDateTimeAPI whenever it is NULL.
2015-06-13 22:46:22 +02:00
Thomas Perl
43e2073429 Simplify test case, add debugging output 2015-06-13 21:15:14 +02:00
Thomas Perl
cf8620502c Add test case for issue #46 2015-06-13 21:08:23 +02:00
Thomas Perl
2378495fa9 Resolve full library path on Android 2015-03-05 20:40:48 +01:00
Thomas Perl
d931071fbd Prepend the PyOtherSide .so to the PYTHONPATH 2015-03-05 19:30:45 +01:00
Thomas Perl
ed58d65d6a QPython15 object 2015-02-21 20:45:53 +01:00
Thomas Perl
adb33c31c7 Minor: Typo fix in changelog 2015-02-21 20:43:07 +01:00
Thomas Perl
30c0247a80 pythonVersion: Return run-time Python version (Fixes #14) 2015-02-21 20:42:15 +01:00
Thomas Perl
84bc298b75 Fix documentation and OpenGL rendering support 2015-02-21 19:55:08 +01:00
Thomas Perl
3ce90c46ec Merge pull request #39 from dtomas/pyopengl
PyOpenGL in PyOtherSide
2015-02-21 19:54:41 +01:00
Dennis Tomas
37ba99e0bf Fixed GIL API usage in renderer. 2015-02-21 13:17:07 +01:00
Dennis Tomas
72925419c2 Implemented PyObjectRef::operator==. 2015-02-21 13:16:03 +01:00
Dennis Tomas
77ecb76492 Unified renderer interface for PyFBO and PyGLArea. 2015-02-21 13:15:49 +01:00
Dennis Tomas
092370631a Use proper way of synchronizing PyFbo and PyFboRenderer. 2015-02-21 13:15:32 +01:00
Dennis Tomas
1ec78f422e Don't clean up an uninitialized renderer. 2015-02-21 13:15:19 +01:00
Dennis Tomas
2662c423b4 Clean up PyGLRenderers before replacing them. 2015-02-21 13:15:05 +01:00
Dennis Tomas
00abfc8570 No need for PyGLRenderer to subclass QObject. 2015-02-21 13:14:44 +01:00
Dennis Tomas
1399072a9c Fixed API usage in PyGLArea example. 2015-02-21 13:14:32 +01:00
Dennis Tomas
b1cd1781d3 Use static_cast. 2015-02-21 13:14:16 +01:00
Dennis Tomas
6209cec9f2 OpenGL rendering to FBO. 2015-02-21 13:14:00 +01:00
Dennis Tomas
0ab3edabc5 Only disable automatic clearing when rendering before QML. 2015-02-21 13:13:39 +01:00
Dennis Tomas
177c5203dc Removed property PyGLArea.t (leftover from Qt tutorial). 2015-02-21 13:13:24 +01:00
Dennis Tomas
873d168444 Improved PyGLArea documentation, added example. 2015-02-21 13:13:10 +01:00
Dennis Tomas
eef5266555 Update PyGLArea when properties have changed. 2015-02-21 13:12:57 +01:00
Dennis Tomas
f08ab6be25 PyGLArea: Pass renderer object instead of function names. 2015-02-21 13:12:41 +01:00
Dennis Tomas
52e75e918f Added null-checks for callbacks. 2015-02-21 13:12:07 +01:00
Dennis Tomas
3e4ea6ee5f Recreate renderer when callbacks have been redefined. 2015-02-21 13:11:48 +01:00
Dennis Tomas
13d22c6e0f Print exceptions in renderer methods. 2015-02-21 13:11:19 +01:00
Dennis Tomas
e126e229e8 Removed some unused private members. 2015-02-21 13:10:59 +01:00
Dennis Tomas
f8de71d449 OpenGL rendering in python. 2015-02-21 13:10:38 +01:00
Thomas Perl
289e5ed616 PyOtherSide 1.4.0 1.4.0 2015-02-19 15:50:51 +01:00
Thomas Perl
efdc4467a9 docs/index.rst: Minor formatting fixes 2015-02-19 15:49:51 +01:00
Thomas Perl
cb7cf698de Merge pull request #38 from danvratil/master
Unbox QJSValue from QVariant in the GUI thread to prevent race condition...
2015-02-19 15:26:27 +01:00
Daniel Vrátil
1c0be92e41 Unbox QJSValue from QVariant in the GUI thread to prevent race condition in QML engine
Calling QJSValue::toVariant() can cause QJSValue to call into QML engine. Since
we perform this correction from QPythonWriter thread context, we end up calling
QML engine from non-GUI thread and causing race conditions and crashes.

This change performs the initial unboxing in QPython::call() and passes to
QPythonWriter the actual value of QJSValue in QVariant.

This fixes issue #36.
2015-02-16 11:19:45 +01:00
Thomas Perl
5b76536332 Add test case for GI import issue (Fixes #23) 2015-01-11 13:47:50 +01:00
Thomas Perl
5c31bde3da Don't register signal handlers (fixes #33) 2015-01-11 13:37:22 +01:00
Thomas Perl
a218e792c3 Merge pull request #31 from M4rtinK/master
PyOtherSide for Android build instructions
2014-11-16 12:42:53 +01:00
Martin Kolman
9d292e2f3a PyOtherSide for Android build instructions 2014-11-15 17:58:55 +01:00