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

175 Commits

Author SHA1 Message Date
Thomas Perl
7e679dbca8 PyOtherSide 1.5.7 1.5.7 2019-06-08 10:32:00 +02:00
Thomas Perl
2ecbef24db Add --embed for Python 3.8 2019-06-08 10:29:31 +02:00
Thomas Perl
4ee441b426 PyOtherSide 1.5.6 1.5.6 2019-06-06 18:01:43 +02:00
Thomas Perl
ed279cb9db
Merge pull request #104 from uglide/allow_embedding_in_qt_app
Use python.h wrapping to allow embedding as-is in any Qt-based project
2019-06-06 17:59:33 +02:00
Thomas Perl
395491f2cd Add test case and documentation for bytes conversion 2019-06-06 17:58:00 +02:00
Thomas Perl
c67604ba4b
Merge pull request #103 from uglide/add_qbytearray_support
Add support for QByteArray
2019-06-06 13:48:24 +02:00
Igor Malinovskiy
4c2bc52fa0 Use python.h wrapping to allow embedding as-is in any Qt-based project 2019-06-05 17:46:35 +03:00
Igor Malinovskiy
b78f53b4e9 Add support for QByteArray
- Add converting from QByteArray to bytes
- Convert bytes to QByteArray instead of trying to parse it as UTF-8 string
2019-06-05 17:16:52 +03:00
Thomas Perl
7f0ff4687b Actually more related to bpo-21536 2019-06-04 21:21:54 +02:00
Thomas Perl
fd7d338b7f Remove untested-for-a-while BB10 build instructions
"BlackBerry will end the support for the operating system at the end of 2019."

            -- https://en.wikipedia.org/wiki/BlackBerry_10
2019-06-04 21:13:16 +02:00
Thomas Perl
60c90c99d1 Docs: Fix ReStructuredText (monospace/code font) 2019-06-04 20:56:58 +02:00
Thomas Perl
e25157409c PyOtherSide 1.5.5 1.5.5 2019-06-04 20:52:03 +02:00
Thomas Perl
a2955b1c53 python.pri: Add --libs to python3-config (Fixes #102) 2019-06-04 20:45:25 +02:00
Thomas Perl
ebe284544e
Merge pull request #100 from heirecka/include-dlfcn.h
Include <dlfcn.h> (for RTLD_{GLOBAL,NOW})
2019-02-08 11:32:16 +01:00
Heiko Becker
4687c5bcb8 Include <dlfcn.h> (for RTLD_{GLOBAL,NOW})
Building against musl libc otherwise fails here with
"global_libpython_loader.cpp:44:47: error: 'RTLD_GLOBAL' was not
declared in this scope".
2019-02-07 19:51:04 +01:00
Thomas Perl
f41ef4db59 PyOtherSide 1.5.4 1.5.4 2019-01-27 12:45:17 +01:00
Thomas Perl
d8d0710e32 Update copyright years (2019) 2019-01-27 12:37:15 +01:00
Thomas Perl
dab1576bb1 Allow calling signals from Python (Fixes #98) 2019-01-27 12:31:27 +01:00
Thomas Perl
067e3a618d
Merge pull request #95 from martyone/qmltypes
Update plugins.qmltypes and more
2018-08-27 12:49:10 +02:00
Martin Kampas
9f7db20aff Update plugins.qmltypes
Using QML2_IMPORT_PATH instead of command line argument to avoid
recording local path in the plugins.qmlypes file.
2018-08-24 07:25:45 +02:00
Martin Kampas
71caa2f837 Add qmltypes make target 2018-08-24 07:06:14 +02:00
Martin Kampas
80b1107b23 Remove unneeded _PRO_FILE_PWD_ use 2018-08-24 07:06:14 +02:00
Thomas Perl
095a54cb42
Merge pull request #87 from thp/set-sys-argv
Initialize sys.argv (Fixes #77)
2017-11-08 23:01:08 +01:00
Thomas Perl
dd72464a06
Merge pull request #88 from blabber/fix_typo
Fix a typo in the documentation
2017-11-08 23:00:30 +01:00
Tobias Rehbein
2738eda21d Fix a typo in the documentation 2017-11-02 21:48:02 +01:00
Thomas Perl
747f6b2747 Initialize sys.argv (Fixes #77) 2017-10-30 13:01:51 +01:00
Thomas Perl
3b27d68af2 PyOtherSide 1.5.3 1.5.3 2017-10-14 12:35:32 +02:00
Thomas Perl
d1e329048a Do not decref PySys_GetObject return values (Fixes #84)
The function PySys_GetObject() returns a borrowed reference
only, so we must incref/decref the value accordingly, and
not take ownership of the returned value.

https://docs.python.org/3/c-api/sys.html#c.PySys_GetObject
2017-10-14 12:31:49 +02:00
Thomas Perl
b435941e51 PyOtherSide 1.5.2 1.5.2 2017-10-14 12:12:32 +02:00
Thomas Perl
5fbcea7053 Add .gitignore file 2017-10-14 12:09:29 +02:00
Thomas Perl
57f484fdd6 Support 64-bit integers when converting from Python (Fixes #86) 2017-10-14 12:08:52 +02:00
Thomas Perl
9f34fea606 Test for >32 bit integer conversion 2017-10-14 12:08:38 +02:00
Thomas Perl
fdb5950acd PyOtherSide 1.5.1 1.5.1 2017-03-17 17:01:37 +01:00
Thomas Perl
cf8a0f8d26 Merge pull request #74 from basak/call_sync_parameters
Fix call_sync when used with parameters
2017-01-05 11:11:56 +01:00
Robie Basak
16fc61db5b Test call_sync with one parameter
Introduce qtquicktests/ with a single test. This allows us to write
tests entirely in QML with no C++ component.

The single test tests for regressions in issue #49.

The qtquicktests framework (supplied by QT/QML upstream) provides only a
template expansion that provides a main() function. Therefore, we must
generate a new binary as the shim for running the tests, as the public
API mechanism doesn't allow us to generate a single binary with the two
backends.

As qmake supports only one binary per directory (without getting really
hacky), we must add a new directory for it.

Perhaps now the tests/ directory should be renamed to cpptests/ or
something for clarity.

Unfortunately "make check" doesn't work, so I've provided a "./run"
wrapper you can run manually from inside the qtquicktests/ directory for
now. This is because qtquicktests appears to have been designed to test
QML apps, not plugins. This isn't much of a problem, except that the
test runner is unable to find the in-tree built plugin.

The generated binary does support a "-plugins <directory>" option, but
it seems to be impossible to get "make check" to use it:

 * The qmake extension supports an INCLUDESPATH to add a
   "-includes <directory> option, but no equivalent PLUGINSPATH.

 * Even though qtquicktests reports "." as being in the plugins
   path after a failure, it does not appear to actually look there, so
   symlinking or copying the plugin in to the current directory doesn't
   work.

 * qmltestcase.prf uses testcase.prf which allows TESTARGS to be
   added. However, it reads this from the environment (a Makefile
   variable) rather than from a qmake variable. There appears to be no
   way of exporting a Makefile variable from a .pro file (unless its
   name is to start with EXPORT_). See
   http://stackoverflow.com/q/35554105/478206.

 * Copying and modifying mysqltestcase.prf from
   /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/ to add a PLUGINSPATH
   configurable option does work, but then you have to run qmake with
   "QMAKEFEATURES=. qmake" since even though it is documented to look in
   the project root, that doesn't work (I tried both the top level and
   inside qtquicktests/).

So I gave up trying to get "make check" to work, and resorted to a
wrapper around calling qtquicktests with the correct options, which at
least works for now.
2017-01-04 23:00:35 +00:00
Robie Basak
260c9c275c Fix call_sync when used with parameters
Factor out the unboxing in call() to a separate method.

To handle direct calls to call_sync(), rename the implementation of
call_sync() to call_internal() and add a call_sync() stub that calls
call_internal().

call_internal() can now takes a boolean "unbox" parameter without
impacting the formal interfaces that call() and call_sync() provide to
QML users. If the "unbox" parameter is true, it unboxes the arguments
first. If false, it doesn't.

Now call_sync() can call call_internal() requesting unboxing. call() can
also do the unboxing itself, and then later process() (the slot for
switching call() to a different thread) can call call_internal()
requesting no unboxing.

Since we now have and must keep track of two versions of the parameters
(boxed vs. unboxed), I also rename these parameters to keep things
explicit and clear.

Here's what was going wrong before:

call() was unboxing QJSValue elements inside the argument list into
plain QVariants, and then calling (indirectly, to switch threads)
call_sync().

call_sync() did no such unboxing. Since call_sync() is exposed directly
as an entry point, this meant that priv->call(), which appears to expect
unboxed argument lists, was failing in this case.

There is a comment noting that call() should do the unboxing in the GUI
thread so should not defer it. So the unboxing has to happen in two
different places depending on whether the user called call() or
call_sync().

Fixes: #49
2017-01-04 22:59:43 +00:00
Thomas Perl
77738b5a76 Merge pull request #72 from waldyrious/patch-1
add license title
2016-08-08 17:51:36 +02:00
Waldir Pimenta
2a71b01544 add license title
It's not strictly required, but it's useful metadata, and part of the recommended license template text:
- http://choosealicense.com/licenses/isc/
- https://opensource.org/licenses/isc-license
- http://spdx.org/licenses/ISC.html#licenseText
2016-08-03 15:36:19 +01:00
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