aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/libpyside
Commit message (Collapse)AuthorAgeFilesLines
* Generate fully Qualified Names for FlagsChristian Tismer2018-07-161-2/+2
| | | | | | | | | The flags structure should give correct full names. See the doc in the issue tracker. Task-number: PYSIDE-747 Change-Id: I6b5c602566d3e4b8a2a93e2522e92da956578b18 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove QT_LOGGING_RULES to fix QLibraryPath pathsCristian Maureira-Fredes2018-06-212-19/+0
| | | | | | | | | | | | | QT_LOGGING_RULES was internally overwriting the PySide2 QLibraryPath configuration, so all the paths were incorrect. Please follow PYSIDE-717 for a discussion on an alternative to have a proper solution. Task-number: PYSIDE-694 Change-Id: I551d7876a416ac31fcff70d843a28c98dfa5ed08 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* PEP 384-squash: Implement PEP 384Christian Tismer2018-05-3018-485/+327
| | | | | | | | | | This is the condensed checkin of 18 commits which created the implementation of PEP 384. Task-number: PYSIDE-560 Change-Id: I834c659af4c2b55b268f8e8dc4cfa53f02502409 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Change license from all the filesCristian Maureira-Fredes2018-05-0332-32/+32
| | | | | | | | | | | | | | | | | Removing the word 'project' from all the headers, and changing the PySide reference from the examples to Qt for Python: The following line was used inside the source/ and build_scripts/ directory: for i in $(grep -r "the Qt for Python project" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/the\ Qt\ for\ Python\ project/Qt\ for\ Python/g' $i;done and the following line was used inside the examples/ directory: for i in $(grep -r "of the PySide" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/of\ the\ PySide/of\ the\ Qt\ for\ Python/g' $i;done Change-Id: Ic480714686ad62ac4d81c670f87f1c2033d4ffa1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Rename PySide references to Qt for PythonCristian Maureira-Fredes2018-04-2732-32/+32
| | | | | | | | | When referring to the project one should use "Qt for Python" and for the module "PySide2" Change-Id: I36497df245c9f6dd60d6e160e2fc805e48cefcae Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Improve qt.conf registration handlingAlexandru Croitor2018-04-202-1/+43
| | | | | | | | | | | | | | | | | | | | | | When PyInstaller is used to deploy a PySide2 application, it changes the layout of the copied PySide2 files (no Qt subfolder, all shared libraries are copied next to tehe generated executable). In that case using the internal qt.conf won't work. Detect if there a exists a qt.conf file next to the executable, and use that file instead. Note that this won't work when the executable path has unicode characters in conjunction with Python 2 and Windows, but that is an unsupported config anyway (due to the mixing MSVC issue). Also add a logging category to ease figuring out which qt.conf file is used if a need ever arises to do so. Task-number: PYSIDE-642 Change-Id: I1260cbc13e5e62be72c4ed9c64c2aa5905d2e9c6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix QtWebEngineProcess related issues on the supported platformsAlexandru Croitor2018-04-201-1/+8
| | | | | | | | | | | | | | | | | | There were 2 issues: 1) QtWebEngineProcess could not be found on Windows because we have a non-standard directory layout for the Qt files we copy over (there is no bin directory), so we need to adjust the internal qt.conf which is set in pyside.cpp 2) QtWebEngineProcess itself does not use the qt.conf from pyside.cpp, because it is a separate executable, and thus we need to supply a qt.conf specifically for it which is placed in the libexec folder. Task-number: PYSIDE-626 Task-number: PYSIDE-631 Task-number: PYSIDE-642 Change-Id: I75d1b083fb5afe5dc31ba90174f42c7f559c5cd5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* fix more qApp crashesChristian Tismer2018-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | When building PySide with a debug Python, a lot more problems become visible. They were triggered by some malicious ordering of the shutdown code, which must come *after* the refcounts of the variables are adjusted. The initial issue PYSIDE-585 was caused because the shutdown code is not only used for every created Q*Application, but also for the module shutdown, which deletes qApp_contents too often. Instead of special-casing that or adding some refcount, it was much more intuitive in that context to set qApp_content's refcount to the same value as Py_None, which also is not supposed to be garbage collected. Btw., the reason for the error message is that Py_None has it, too. When we set qApp_content's type to Py_None's type, it inherits the protection code that prevents someone from garbage collecting Py_None. Task-number: PYSIDE-585 Change-Id: I4af9de1192730f06054a5aca099a32e2392e367d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use XINCREF/XDECREF in PyObjectWrapper constructorCristian Maureira-Fredes2018-04-191-6/+6
| | | | | | | | | | | | When emitting a None signal the PyObjectWrapper constructors in the signalmanager were not working properly, but using the safe macros to increase and decrease the references of the object solves the issue. Task-number: PYSIDE-17 Change-Id: I1871e5b8227d6ddc893afce2ab9b311b60649024 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Check slot-signal association when connectingCristian Maureira-Fredes2018-03-021-3/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When connecting a signal with a slot there is a process to associate the proper signal signature, but the slot signature was not verified. This missing verification step lead to wrongly associate the slots and the signal signatures, for example: def on_clicked(checked=True): ... QGroupBox.clicked.connect(on_clicked) will wrongly connect the slot "on_clicked" with the signal "clicked()" (without any argument), when the proper signal is "clicked(bool)". This can be solved by manually specifying the arguments: QGroupBox.clicked[bool].connect(self.clicked) We can add an additional verification step to associate the proper signal if the slot has a certain number of arguments. There is an existing test that checks the compatibility of this change with all the ways to connect signals and slots. A few additional cases were added. Task-number: PYSIDE-104 Change-Id: Ic5b06fa3bb91903f7d506e0e2c52a6f7d3dc4570 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2018-02-231-1/+1
|\ | | | | | | Change-Id: I5d1a4734e8f44785898ba62beaa0bdd2004fca22
| * Don't copy duplicate libraries on package installationAlexandru Croitor2018-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes sure to resolve symlinks and copy only one file for every dynamic shared library used (vs 3 before -> 2 symlinks + 1 actual library). This avoids duplicate files, as well as saves space when creating wheel (e.g. no 3 copies of standalone WebEngine library). This filtering happens copying from CMake install dir into pyside_package_dir (the symlinks are still present in the CMake dir, but that shouldn't harm anybody, and might be useful for users of shiboken only for example). Task-number: PYSIDE-495 Change-Id: I0fe454e16c6b254a8682aa7b1c702ec01a3064f0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Fix usage of PyCFunction_GET_FLAGS in pysidesignal.cppAlexandru Croitor2018-02-141-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using PyCFunction_GET_FLAGS is unsafe, because it does not check whether the argument given is actually a PyCFunction object. This macro needs to be replaced with the function equivalent PyCFunction_GetFlags for stable ABI patch, but this will cause a crash in PyCFunction_Call because we don't check the return value of PyCFunction_GetFlags to see if it fails. Rather than checking the return value, it is safe to preemptively add a PyCFunction_Check before calling the GetFlags function. This does not modify the logic behind signalCall function. The crashing test was homonymoussignalandmethod_test.py, so no new test is needed. Task-number: PYSIDE-593 Change-Id: Id9ac9c0dec454e8e1ce9516dc68af924372a34a9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Fix error with second Qt.UniqueConnection callCristian Maureira-Fredes2018-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation was considering only Py_True as a success, but not Py_False. The else statement will enter just in case of error, as intended. Added a test case to verify the proper behavior of Qt.UniqueConnection. Task-number: PYSIDE-34 Change-Id: I5bafe0e81383022dcd7fc6251fc61d0ab5e918d0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Remove examples submoduleFriedemann Kleint2018-01-251-4/+1
|/ | | | | Change-Id: I0e4e3472e1d5644db281fb46ce4ba4ddfc1eafae Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* libpyside: Fix code forwarding Python exceptions to JSFriedemann Kleint2017-11-301-14/+4
| | | | | Change-Id: I6dffab506814e1d33812ed23b3e3920882b6c4e6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make standalone installations relocatableAlexandru Croitor2017-11-153-1/+149
| | | | | | | | | | | | | | | | | | This is achieved by registering a qt.conf file with a Prefix pointing to a directory relative to the loaded PySide2 module (e.g. QtCore). Thus Qt does not crash due to not finding platform plugins. Because this change would affect tests, which are ran before the PySide package is installed, a new environment variable called PYSIDE_DISABLE_INTERNAL_QT_CONF is introduced. This variable disables the registration of the internal qt.conf file, thus it will not point to a not yet created location, which will allow tests to run as before. Change-Id: I5a96037adfafe1f08ea57535aa4a2a0d1660dfaf Task-number: PYSIDE-558 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Remove dead / unused code regarding conversionsAlexandru Croitor2017-11-026-306/+5
| | | | | | | | | | | | | | | | | | | | | There's a lot of code that was previously used for doing conversions between C++ / Python types (apparently relying on extensive RTTI / typeid manipulations), which got superseded by a cleaner templated approach. The old code was left behind, and there were a few instances where it was still used even though it wasn't needed, like in QtScript typesystem XML and shiboken's enum handling. Remove the old code, apply the small changes needed to make it work with new the code. This is cleanup to reduce the confusion regarding conversion behavior, and also preparation for a proper implementation of handling "void*" types. Change-Id: I8f16bb31436f9a677bb2d64c7197c4375005b656 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Support the qApp macro correctly, final version incl. debugChristian Tismer2017-10-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For short the new features: - there is a qApp in QtCore, QtGui and QtWidgets for compatibility, and also in __builtins__ for a true macro-like experience. - if you delete any qApp variable, the Q*Application is reset and you can start over. Long description: There is a qApp macro in Qt5 which is equivalent to Q*Application.instance() . Python does not have macros. Both PyQt5 and PySide2 have an according structure in QtWidgets. In the case of PySide2, the qApp variable is first initialized to None and later to QApplication(). This does not reflect the original sense of the qApp macro, because - it only handles QApplication, - it does not handle destruction. This "macro" should live in QtCore, but both PyQt5 and PySide2 decided to put this in QtWidgets. As a compromize, I propose to put qApp into all three modules, and into __builtins__ as well, so wherever you create an application, you find this "macro" in place. While changing the code, I stumbled over the template set_qapp_parent_for_orphan. I tried to make sense out of it and finally removed it. There were no side effects but bug PYSIDE-85 is gone, now. With some extra effort, I created a singleton qApp that changes itself. This way, a true macro was simulated. Note that this was not possible with a garbage collected variable, and I had to make shiboken aware of this. As the final optimization, I turned qApp also into a fuse variable: Delete any qApp variable and Q*Application will finish when there is no extra reference. Task-number: PYSIDE-85 Task-number: PYSIDE-571 Change-Id: I7a56b19858f63349c98b95778759a6a6de856938 Reviewed-by: Christian Tismer <tismer@stackless.com>
* consistently name site-packages in Shiboken and PySideChristian Tismer2017-08-242-2/+2
| | | | | | | | | | | | The variable used for the python site-packages is inconsistent. Instead of "SITE_PACKAGE", we use "PYTHON_SITE_PACKAGES" everywhere. Task-number: PYSIDE-563 Change-Id: I4d2d49f20f5a0a13439bc7b8c79ab318cd831cb9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Julien Schueller <schueller@phimeca.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Improve suffix names for shared libraries and cmake config filesAlexandru Croitor2017-07-124-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | This change decouples the naming of general shared libraries, python module extensions, and cmake configuration files. All of them are now computed depending on the python version and python build configuration, and can also be manually set via CMake variables. The module extensions names now use the most detailed 'import' prefix, which usually informs whether a debug or release python was used, or the Python ABI flags (for Python >= 3.2). When a debug Python interpreter is used for building PySide2, the preprocessor define Py_Debug is now correctly propagated to PySide2 sources, which fixes previous crashes in debug builds. This affects only Linux and macOS builds. There is a subsequent change for making it work for Windows builds. All in all, this now allows proper mixing of debug / release versions of the Python interpreter with debug / release versions of PySide2 on Linux and macOS. Task-number: PYSIDE-508 Change-Id: I88a05c3ada0fb32c7c29bdb86d7a2c15acc963b8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* libpyside: Use Q_SLOTS instead of slotsFriedemann Kleint2017-06-021-1/+1
| | | | | | | | | When mixing Python and C++, Qt needs to be used with 'CONFIG += no_keywords' to suppress the 'slots' macro definition, which clashes with a Python header. Task-number: PYSIDE-526 Change-Id: I4feeae2de21db712b4de6653e243d556623436a1 Reviewed-by: Christian Tismer <tismer@stackless.com>
* move everying into sources/pyside2Oswald Buddenhagen2017-05-2238-0/+7748
in preparation for a subtree merge. this should not be necessary to do in a separate commit, but git is a tad stupid about following history correctly without it.