aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/tests
Commit message (Collapse)AuthorAgeFilesLines
* Check slot-signal association when connectingCristian Maureira-Fredes2018-03-021-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-232-52/+0
|\ | | | | | | Change-Id: I5d1a4734e8f44785898ba62beaa0bdd2004fca22
| * Remove _utils.py module from packageAlexandru Croitor2018-02-222-52/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt4 days, _utils.py was used to register a custom qt.conf file into the Qt Resource System, which contained a Prefix (and other locations like binaries / QML imports) so that QtCore can find the correct location of the QPA plugin, and all other requirements. The code was not adopted to work for Qt5, and was silently failing without doing anything. It is not needed anymore though, since the qt.conf registration is now done in C++ in libpyside shared library, since the commit e455d995be989cbdfef2bcd54fd7057a9b036b52 . Thus remove the _util.py file, and adjust __init__.py accordingly. Task-number: PYSIDE-600 Change-Id: I76e3ea442a6e9b9df4996e628ffffcc7384b7f82 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Remove the internal functions Qt::get_enumName()/Qt::get_enumMetaObjectFriedemann Kleint2018-02-213-12/+0
| | | | | | | | | | | | | | | | | | | | They apparently originate from an expanded macro and result in doc warnings. Change-Id: I2418034f643156855091e1e94e0fbb2a58e77bfc Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Add condition to qmimedatabase_testCristian Maureira-Fredes2018-02-151-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | An assert related to a Mimetype comment fails if the language is unset or is not English. Since this assert is not critical to the functionality of the module, we can remove it or add a simple condition to test it only when the system's language is English. The last one was applied. Task-number: PYSIDE-575 Change-Id: Ida85268e25522e406878dd6ac4e5e70852f8d8e4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Fix lost reference for item delegatesCristian Maureira-Fredes2018-02-142-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | After setting an item delegate for columns and rows in classes that inherit from QAbstractItemView (like QTreeView) the reference was not kept, causing a segfault. This was solved by keeping the reference of the object. A test is provided. Task-number: PYSIDE-226 Task-number: PYSIDE-219 Change-Id: I43eeb6e85a37537311d838f5abb0ee1ab10ea713 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2018-02-022-0/+64
|\| | | | | | | Change-Id: I777970f7bb17db766660d82556559eadd7293355
| * Fix QTabWidget.clear to avoid double obj removalCristian Maureira-Fredes2018-02-022-0/+64
| | | | | | | | | | | | | | | | | | | | | | Replacing shiboken call setParent with releaseOwnership so Python will not delete the underlying C++ object. A test case is provided to check that the error is not happening. Task-number: PYSIDE-213 Change-Id: Ic0f383c3d93b905885f76788d32d62ba37ed9d2f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Registry: Trigger re-generation of files for Qt3DChristian Tismer2018-02-024-848/+911
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is phase 2. The files are generated. I only changed the date in the license section. After this check-in, the update is done. From Phase 1: The function registry does not contain the new Qt3D module. This produces no error because the test is configured to only break on missing functions but not on new unknown functions. We provoke a reaction of the system by removing of the 5.9 registry files. The system will generate an error once and produce the desired output. But because of the multiple testing, the test will succeed because the generated file exist on the second run and therefore the test will succeed as a flaky test. There is only one run necessary for all platforms at once. A second check-in will then do the update with the generated data. I also had to fix the testrunner to produce a good listing without labels. Task-number: PYSIDE-487 Change-Id: I06a73d244ce306977fd16223eec4dc491fff3429 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Fix error with second Qt.UniqueConnection callCristian Maureira-Fredes2018-02-011-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Add code to invalidate objs on QListWidget.clearCristian Maureira-Fredes2018-01-311-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported on PYSIDE-264, when an item of an already cleared QListWidget was being accessed, a segfault happened when trying to access this deleted data. Due to the lack of an invalidation process of the python objects when clear() was called, the generated validation step before accessing the data had no effect. This was solved injecting code to set their parents to NULL, and invalidating them. The outcome of trying to access deleted data then will be a RuntimeError, instead of a segfault. A test case is provided. Task-number: PYSIDE-264 Change-Id: If52dd85827500c96a078a8f9d61921a275fb28f9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Add Qt3DFriedemann Kleint2018-01-318-0/+161
| | | | | | | | | | | | Task-number: PYSIDE-487 Change-Id: I17100eda57fbe5015b6c8ff531a3c62b22e8de95 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2018-01-191-3/+4
|\| | | | | | | Change-Id: I5f2e1660a27efafa445592898db4dfe3250306e0
| * qinstallmsghandler_test.py: Test qDebug() in debug builds onlyFriedemann Kleint2018-01-161-3/+4
| | | | | | | | | | | | | | Otherwise, messages are suppressed and the test fails. Change-Id: Ie7fb8192e542a09822f6e1f70392100f4cdc0f11 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Add bindings for QHelpSearchResultCristian Maureira-Fredes2018-01-152-0/+45
| | | | | | | | | | Change-Id: I256eced0fb4fcef097c63cdf63257e89953c54d0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Fix return conversion for readData/readLineDataCristian Maureira-Fredes2018-01-152-0/+83
| | | | | | | | | | | | | | | | | | The proper approach is to replace the returning data as Python Strings instead of QByteArray. Task-number: PYSIDE-40 Change-Id: I554b88bb79b7ae7d36fdc8c597704e3fcadd4527 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Add bindings for QColormapCristian Maureira-Fredes2018-01-092-0/+44
| | | | | | | | | | | | | | | | Removing depth and Mode from tests. assertEqual instead of assertTrue. Change-Id: I9f0f04a460790b65af264c58ab65f248ae207e81 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2018-01-052-5/+7
|\| | | | | | | Change-Id: I254cc725505349e73c7abc290afc7abb85156997
| * Signature existence tests: Fix generation of the signature fileFriedemann Kleint2018-01-042-5/+7
| | | | | | | | | | | | | | | | Amends cd1037060e0cbc263e601fb67fbd40d85c8801a1. Task-number: PYSIDE-510 Change-Id: Ic93a6ef4ab846b07b369f691f52240aeedbfbec3 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-12-215-138/+255
|\| | | | | | | Change-Id: I78039827d32c1d4d540a8b1b2afd4841e40d5c2c
| * Signature existence tests: Fall back to previous patch releasesFriedemann Kleint2017-12-212-18/+51
| | | | | | | | | | | | | | | | | | | | | | In case the reference file for a given patch release does not exist, fall back to a previous one. Replace variables in the init_platform module by functions getEffectiveRefPath(), getRefPath(). Task-number: PYSIDE-510 Change-Id: I208f4618be6e20be5023938850ca0eacc43b0101 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Fix QtCore test bug829 to run on WindowsFriedemann Kleint2017-12-191-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The test used Python functionality to create a temporary file which caused an access error on Windows, apparently due to the file still being open. Besides, the temporary file was leaked. Rewrite using QTemporaryFile and make sure the file is closed and the QTemporaryFile is deleted before using it and delete it in __del__(). Task-number: PYSIDE-431 Change-Id: I5d63e76ead7169d9f3f2267ee53aa91b601a3968 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Unify signature registry for py2 / py3 and clean upChristian Tismer2017-12-054-86/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turned out that there are tiny differences between Python2 and Python3 which make the versions of the registry almost, but not totally equal. There are functions which are slot wrappers in Python2 instead of method wrappers in Python3, and we currently don't support slot wrappers. There are other tiny differences when we switch to Qt 5.9, too. Initially, I thought to split the files for Python2 and Python3, but then it turned out that the problems vanish when we ignore the 'next' and '__next__' functions in both python versions. The filter function is both applied to the generating function and the testing function. Therefore we can keep the existing data intact. I further removed an indentation leftover in cppgenerator.cpp, fixed handling of duplicate entries and improved modularisation of the signature enumerator and formatter. This part will later be moved into the signature library. Task-number: PYSIDE-510 Change-Id: I18f5e8f08fb9b07534003919abe55ab4dafeb2c2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Fix signature registry on Python2 with .pyc files, part 2Christian Tismer2017-12-043-49/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There is unfortunately another bad side effect with .pyc files. I had to make sure that not the __file__ attribute is used, but the correct filename is computed, because __file__ can refer to the .pyc file under certain circumstances. Improved error handling, more file type checks and short filenames relative to the project path added for convenience. Task-number: PYSIDE-510 Change-Id: Ia0002fdfb382b7d3681156b1aef42739eb22dcc9 Reviewed-by: Simo Fält <simo.falt@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-11-302-8/+11
|\| | | | | | | Change-Id: I8325557c5ac81f81f03489f5f8ebb9111e04c8cb
| * Fix signature registry on Python2 with .pyc filesChristian Tismer2017-11-302-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a problem on Python2 when ci was activated. Because there are .pyc files in the same folder, a leftover .pyc file would be imported and lead to weird results. This problem is not recognized now, but would have effects when we turn on the multiple testing. The intended behavior is that a tests generates an error and a listing once and succeeds for the repeated test runs. This worked in Python3. Now this works the same with Python2. Task-number: PYSIDE-510 Change-Id: Id892715faa8eee1322b28c7e109f3b0b7329f12c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-11-2715-53/+96284
|\| | | | | | | Change-Id: I79637555fbfbd596dee4313baf80149d03bb5206
| * Create a function existence registryChristian Tismer2017-11-271-0/+16636
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the signature module, it is now a straight forward task to generate a registry of all known function signatures. We check that these signatures all exist. One file contains all signatures for one platform and version. The test is only activated when run in the CI system. An initial call creates the expected file as output and raises an error. The result can then be picked up from the error log and added to the repository. The linux2 and linux platforms are now unified. There will be a new version of testrunner.py which is more versatile. In future, this teach-in process will be made much easier because we will be able to view the initial versions without raising an error. Done: linux 5.6.4 Done: darwin 5.6.4 Done: win32 5.6.4 Done: darwin 5.9.3 Done: linux 5.9.3 Done: win32 5.9.3 Task-number: PYSIDE-510 Change-Id: I4e3953f9d8e781ae170b455dc7884da9bf632f47 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Create a function existence registryChristian Tismer2017-11-277-69274/+37211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the signature module, it is now a straight forward task to generate a registry of all known function signatures. We check that these signatures all exist. One file contains all signatures for one platform and version. The test is only activated when run in the CI system. An initial call creates the expected file as output and raises an error. The result can then be picked up from the error log and added to the repository. The linux2 and linux platforms are now unified. There will be a new version of testrunner.py which is more versatile. In future, this teach-in process will be made much easier because we will be able to view the initial versions without raising an error. Done: linux 5.6.4 Done: darwin 5.6.4 Done: win32 5.6.4 Done: darwin 5.9.3 Done: linux 5.9.3 Task-number: PYSIDE-510 Change-Id: Ib57e1e1771649c95435132a9fc65d86f4a3df05b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Create a function existence registryChristian Tismer2017-11-243-9648/+25921
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the signature module, it is now a straight forward task to generate a registry of all known function signatures. We check that these signatures all exist. One file contains all signatures for one platform and version. The test is only activated when run in the CI system. An initial call creates the expected file as output and raises an error. The result can then be picked up from the error log and added to the repository. Done: linux2 5.6.4 Done: darwin 5.6.4 Done: win32 5.6.4 Done: darwin 5.9.3 Done: linux2 5.9.3 Done: linux 5.9.3 Task-number: PYSIDE-510 Change-Id: I32dfd5fcd56ca8d91d48a81959cc762cd5340c68 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Skip some permanently failing tests and blacklist flaky onesAlexandru Croitor2017-11-242-2/+6
| | | | | | | | | | Change-Id: Idcbf62b58f097370f61a27d0f16bce630e817526 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Create a function existence registryChristian Tismer2017-11-241-0/+16246
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the signature module, it is now a straight forward task to generate a registry of all known function signatures. We check that these signatures all exist. One file contains all signatures for one platform and version. The test is only activated when run in the CI system. An initial call creates the expected file as output and raises an error. The result can then be picked up from the error log and added to the repository. Done: linux2 5.6.4 Done: darwin 5.6.4 Done: win32 5.6.4 Done: darwin 5.9.3 Done: linux2 5.9.3 Task-number: PYSIDE-510 Change-Id: I00cc1a4854a8149a40659c04d81ffd3e6db64bc8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Create a function existence registryChristian Tismer2017-11-242-1/+16460
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the signature module, it is now a straight forward task to generate a registry of all known function signatures. We check that these signatures all exist. One file contains all signatures for one platform and version. The test is only activated when run in the CI system. An initial call creates the expected file as output and raises an error. The result can then be picked up from the error log and added to the repository. Done: linux2 5.6.4 Done: darwin 5.6.4 Done: win32 5.6.4 Done: darwin 5.9.3 Task-number: PYSIDE-510 Change-Id: Ib366f60d527ee8b043c7ee16430fdda42c707cfe Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Fix crashes on RHEL 6.6 CI machines due to a race condition in glib2Alexandru Croitor2017-11-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Qt launches the QXcbEventReader thread, by default the created thread dispatcher will call g_thread_init_glib to initialize the glib thread. When libqgtk2 plugin is loaded, the plugin calls gtk_init which also needs to initialize the glib thread library. This can cause a race condition where the xcb thread might not finish initializing all of the glib thread library, but the main thread believes that initializing is done, and thus ends up dereferencing null pointers. Specifically when the glib function g_slice_alloc is called in the main thread, which calls allocator_categorize, the glib initialization flag 'sys_page_size' is checked. This flag can already be set by the call to g_slice_init_nomessage in the xcb thread, but magazine_mutex might not yet be allocated (in g_slice_thread_init_nomessage), and the main thread ends up dereferencing a null pointer mutex. Relevant code can be found at https://sourcecodebrowser.com/glib2.0/2.27.4/gslice_8c_source.html The workaround is to set the QT_NO_GLIB environment variable to 1 when running the tests, so that a regular QEventDispatcherUNIX is used. Thus only the gtk plugin will call the glib initialization function, eliminating the race condition. Note that the issue probably happens only for glib versions < 2.32. The g_thread_init function is deprecated since 2.32, and glib thread initialization is done at the start of the program, as referenced at https://developer.gnome.org/glib/2.32/glib-Deprecated-Thread-APIs.html#g-thread-init Task-number: QTBUG-64716 Change-Id: Ibcccf8f6e0a3299e61dd320eb6d08e29658298e2 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * Create a function existence registrymaya1Christian Tismer2017-11-1911-11/+62731
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the signature module, it is now a straight forward task to generate a registry of all known function signatures. We check that these signatures all exist. One file contains all signatures for one platform and version. The test is only activated when run in the CI system. An initial call creates the expected file as output and raises an error. The result can then be picked up from the error log and added to the repository. Done: linux2 5.6.4 Done: darwin 5.6.4 Done: win32 5.6.4 Task-number: PYSIDE-510 Change-Id: I4f406cf72d25fdd2336814f6f20129079b8be54f Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Make standalone installations relocatableAlexandru Croitor2017-11-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 QtCore::static_protected_methods_testFriedemann Kleint2017-11-142-60/+0
| | | | | | | | | | | | | | | | | | The test calls QThread::sleep(), which was static protected in Qt 4, but is public in Qt 5. In addition, the test is flaky on macOS. Task-number: PYSIDE-431 Change-Id: Ie0faae785cda61937b3f20290f1dccbcb20bffda Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Update and complete the signature moduleChristian Tismer2017-11-141-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is now an external typing module for Python 2.7 and Python 3.6 from Guido (PSF license again) that makes the differences between both versions vanish. Also, when generating interface files, some types did not show correctly, and the constant "0" is wrong in almost all cases. Values in signatures looked often bad since they have no nice __repr__, and it was almost impossible to create correct .pyi files. Now, these instances are created as wrapped string types with a nice __repr__. A call of these objects creates the real constant. This way, also objects can be rendered which are dependent from the existence of other objects (i.E. QPixMap). This patch improves the usability of the signature module. We can now generate source code or .pyi files without modifications. Task-number: PYSIDE-510 Change-Id: I55490d76a29fc6c0e4f821c0c77d5e5d1e28976e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Add QAxContainerFriedemann Kleint2017-11-141-0/+1
| | | | | | | | | | | | Task-number: PYSIDE-487 Change-Id: I5ba8e54f7e496e960fc6017b51eb4f22eb9f54b6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-11-131-10/+6
|\| | | | | | | Change-Id: Ib0f638130d21a5619f239a9fb8beb7d92ad8d0e8
| * Remove sys.path manipulations from testAlexandru Croitor2017-11-081-10/+6
| | | | | | | | | | | | | | | | The sys.path hack is no longer necessary because we pass a proper PYTHONPATH from the CMakeLists file to the test wrapper. Change-Id: Ie9ad8802e64cf7c9ffec16ae55777d5d23654662 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-11-061-1/+0
|\| | | | | | | Change-Id: I72583df407fc5b3caa8bf35fd997889a4ac86512
| * Implement proper void pointer (void*) supportAlexandru Croitor2017-11-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a new type into the shiboken2 module which is imported by calling "import PySide2.support.VoidPtr". The type takes care of conversions from / to void* values in function signatures. Creating an instance can be done by passing either a shiboken wrapped object, or an integer representing an address, or a python object that implements the buffer interface. For example, this is useful for passing numpy arrays to C OpenGL functions that take void* parameters. First you convert the array into a bytestring (using numpy.array.tobytes(), then you instantiate a VoidPtr from that bytestring, and finally you pass it along to a GL function. One corner case that is currently not supported is void** parameters. Change-Id: I01e291d6856cb6bd8b5175adc3ead6b728036535 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | PySide2: Simplify typesystem path handlingFriedemann Kleint2017-11-062-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify the typesystem.xml files such that all dependent files are loaded via module (for example, QtCore/typesystem_core.xml). As a result, it is no longer necessary to add each dependent directory to the typesystem path; it is sufficient to pass the binary and source path of PySide2 and the source directory of the Qt module only. This requires rewriting the dependency checking for --reuse-build so that it loops over the source directories of the dependent Qt modules. Change-Id: Ib234c2673f4ee93cc8a3282fac69bcfcfaebd0ac Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-10-273-1/+85
|\| | | | | | | Change-Id: I94cb5a7dab97cff3591bac534228bfd3e3ad5938
| * Support the qApp macro correctly, final version incl. debugChristian Tismer2017-10-272-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Stabilize QtQml/bug_847.pyFriedemann Kleint2017-10-271-1/+8
| | | | | | | | | | | | | | | | | | Add more checks for QML loading. Wait until the window is exposed until starting the safety timer and increase its interval. Task-number: PYSIDE-431 Change-Id: I6225f2357d9576be15c6134d26982939698a9984 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-09-282-0/+154
|\| | | | | | | Change-Id: I47521e21977b1f17fcc65590f565270b2440a48b
| * Signature: Improve error reportingChristian Tismer2017-09-251-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | It is likely that with Qt 5.9 we get new signature text that is not recognized. This becomes a problem because COIN takes much time. This patch does not stop on the first parser error, but collects all warnings and raises an error at the end. Task-number: PYSIDE-510 Change-Id: I898e0a7a59e8313c115d7ce8160908bf85d4140c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Implement introspection with __signature__ packageChristian Tismer2017-09-202-0/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signature module was turned into a package under 'PySide2/support/signature'. The package is completely isolated so that nothing is leaking into the normal import machinery. The package is also not initialized unless a __signature__ attribute is accessed. The only change to Python during a PySide run is the existence of the __signature__ attribute. As a side effect, all tests run at the same speed as before this extension. The module does not actively import PySide modules. Instead, it inspects sys.modules and reloads its mapping.py if needed. Example usage: >>> PySide2.QtWidgets.QGraphicsAnchorLayout.addAnchors.__signature__ >>> PySide2.QtWidgets.QGraphicsAnchorLayout.__signature__ The module has been thoroughly tested on macOS. I consider this ready. Task-number: PYSIDE-510 Change-Id: Ibb231a7fbb4ccc1a7249df55e3881a4e21a19c0d Reviewed-by: Christian Tismer <tismer@stackless.com>