| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Adapt CMake files, build scripts, tests and examples.
Task-number: PYSIDE-904
Change-Id: I4cb5ee4c8df539546014b08202a7b1e98ed3ff07
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|\
| |
| |
| | |
Change-Id: I27beffe4a6e2fc2f818960c3b9f5ffbfaac4a670
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Mimicks some template which might be used trying to enforce
correctness of units by type checking.
Task-number: PYSIDE-725
Change-Id: Ia7008d7db5638920eee3d0ef36cc32a63796b98e
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|\|
| |
| |
| | |
Change-Id: Idaf124ad5e1d6a41d52918cecba47499be5e7324
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
namespaces
Add them in ShibokenGenerator::getFunctionGroupsImpl() with some
helpers.
Fixes: PYSIDE-1075
Change-Id: Ie627c6e12f82e40cdb4f306ddac6b682e77124c5
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
functions
Mainly add those in ShibokenGenerator::getGlobalFunctionGroups() with
some adaptions.
Task-number: PYSIDE-1075
Change-Id: I6dabac72c204904e76162542b5aa3ea1ac3b56ec
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
View types as function parameters cannot be converted in the standard
way shiboken does it:
QStringView cppArg0;
pythonToCpp(pyArg, &cppArg0);
since they reference some other data.
Introduce a new "viewOn" member to type system entry for them. It
causes the function arguments to be replaced by their viewed-on types
(stringview->string) via metatype.
Add a test in libsample and a test for QUuid::fromString(QStringView).
Test returning QStringView via QRegularExpressionMatch::capturedView().
Task-number: QTBUG-84319
Task-number: PYSIDE-1339
Task-number: PYSIDE-904
Task-number: PYSIDE-487
Change-Id: Iddb4ea268a54928d290e29012e2738772fae83f0
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
protected hack
Add a missing check for final class.
Amends 170756fa1e5de0ce7ba33521f1eb168d70ad276d.
Fixes: PYSIDE-1388
Change-Id: I6b7cd5c9a769838287ac7165bdc2d5ad63b289a1
Reviewed-by: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the tests for PYSIDE-1074 from samplenamespace.h to
removednamespaces.h. The latter has also a test case for an
invisible namespace under a visible namespace besides the
invisible top level namespace test.
Task-number: PYSIDE-1074
Task-number: PYSIDE-1075
Change-Id: I5d1c6428f6ceadf929063c2c69723a7871173f4e
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
| |
Change the formatting for better readability and use
the "visible" attribute instead of the deprecated "generate".
Task-number: PYSIDE-1075
Change-Id: Ibbb33d2482c1d682f74d2edce2dd7d3bb1a50821
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add an XML attribute specifying whether code is to
be generated to the XML properties.
- Split the generator functions for field setters and getters
apart so that they can be used for generating property
setters and getters.
- Generate code for all properties from XML when the PySide
extension is not used, otherwise only for those with
the attribute set.
Task-number: PYSIDE-1019
Change-Id: Iab2ba38b90038edc667a233c23c7113fdc6fb438
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
They were ignored in the code parser. Take them into
account and add a test.
Task-number: PYSIDE-1224
Change-Id: I3baca95556129d695db294fdcc1ad92fc831672d
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Add an attribute to specify a number by which the functions
will be sorted. This deactivates the default sorting
which tries to avoid implicit conversions.
Fixes: PYSIDE-1366
Change-Id: I9a891e21f86152b2fdfda9a48d685f19aa936508
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As of Qt 6, there is a trend of hiding bool returns of comparison operators
of container classes behind some template expression which the clang parser
cannot identify. To work arouind such cases, make it possible to add
them as functions without code injection which will generate the
default code.
Task-number: PYSIDE-1339
Task-number: PYSIDE-904
Change-Id: Ia7bf5d583e0f80505fe1b759347955fec5dca600
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Although it is a questionable practice, it occurs in Qt 6:
virtual const QEventPoint &QPointerEvent::point(int i) const;
Previously, the generated return statement
return QEventPoint();
would cause a warning about returning a temporary.
Fix by creating a static variable and returning a
reference to it.
Task-number: PYSIDE-1339
Task-number: PYSIDE-904
Change-Id: Id6467be22a166e99e8dcf08b2c7c14df33cd2786
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Occurs in Qt 6:
QKeyEvent(..., const QInputDevice *device = QInputDevice::primaryKeyboard());
We need a const-cast here since shiboken needs a QInputDevice * for type
conversion.
Change-Id: Iea1137eac44a26b7bc9cf0e1908c0e42ba2de39f
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|\
| |
| |
| | |
Change-Id: I6cf604e1ae7234ce4f0d99169e9269a7dde07a4a
|
| |
| |
| |
| |
| |
| |
| |
| | |
Specifying {} causes it to be qualified, check this.
Change-Id: Idd23c8a5af01cd7fbb63a2e5a01bb349c530fe54
Fixes: PYSIDE-1325
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Setattro/getattro functions can be added. As shiboken
also uses these functions internally, the code blocks
are inserted into those implementations.
As those are special functions, only raw code is injected.
No macros are replaced for arguments or instances.
Fixes: PYSIDE-1280
Change-Id: I207dcf70b3a9f5edc51ff6566b31a2a8aa4776ed
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There was an existing functionality to hide namespaces when
specifying generate="no" on namespace-type which did not work
for classes.
In addition, it was implemented using the generation
attributes of TypeEntry. This is problematic since dependent
typesystems are loaded with generate="no", which actually
means that no code should be generated for them.
To fix this, introduce a new "visible" attribute for namespaces
which also accommodates for hiding C++ 11 inline namespaces.
Some projects uses the namespaces as packagename while
creating python bindings, and to avoid duplicate names they
ignore the original c++ namespace.
For example a class like that:
namespace Qt3D {
class Vector;
}
The namespace "Qt3D" will be used as package name so the
namespace "Qt3D" should be ignored during the generation,
otherwise the 'Vector' type will be represented by
'Qt3D.Qt3D.Vector' and that is not what we want.
Initial-patch-by: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
Fixes: PYSIDE-1074
Change-Id: I3fd391ac3d839d3f8f510c6a4d4000f7d92eacff
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rename a class and test repr and signatures of users.
The test fails
F
======================================================================
FAIL test (__main__.RenamingTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "renaming_test.py", line 46, in test
"(self, v 'sample.RenamedValue')")
AssertionError "(self, v: 'sample.ToBeRenamedValue')" != "(self, v: 'sample.RenamedValue')"
- (self, v 'sample.ToBeRenamedValue')
? ----
+ (self, v 'sample.RenamedValue')
Task-number: PYSIDE-1133
Task-number: PYSIDE-990
Task-number: PYSIDE-1074
Change-Id: I402439fd202c33cac281c4628ceba79406198a27
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
- Do not try to resolve modified default expressions (add enumeration
scopes or similar)
- Fix the signature parser to handle arbitrary expressions
Fixes: PYSIDE-1095
Change-Id: I059c3a1f066687d7c2f0dad9ea7f0d93e292b1b5
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
| |
Apply Fixits by Qt Creator with some amendments.
Remove iterator types by using auto instead.
Change-Id: I8a75323da6ae5cdcc6b67af8be9376408953986b
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
| |
Apply Fixits by Qt Creator with some amendments.
Change-Id: Ie8300ddb834adb8b649324562f2c912a4e8cf4ce
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use target_* commands instead of subdirectory based commands
for adding link options, compile definitions, include directories,
etc.
Remove some non-used compile definitions.
Move around some of the find_package() and option() calls.
Simplify some of the package dependent logic.
Replace the qt include and linking variables with CMake targets.
Change-Id: I815595344e63a32dce3dc78652359beede3ff593
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Array modifications did not work in template specializations (like
typedef QGenericMatrix<2,2,int> QMatrix2x2> causing warnings like:
There's no user provided way (conversion rule, argument removal, custom code, etc) to handle the primitive type
'const float *' of argument 1 in function 'QMatrix2x2::QMatrix2x2(const float * values)'.
Rewrite the array modification code to operate on AbstractMetaType
only instead of requiring code model data types and add the missing
handling to AbstractMetaBuilderPrivate::inheritTemplate().
Add a test.
Note that the warning was fixed by another change removing the array
modification since it did not take effect due to the presence of a
manually added PySequence constructor.
Change-Id: Ie4a1092fbef7237f8858790a74e2f75070ef6586
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ShibokenGenerator::isValueTypeWithCopyConstructorOnly()
returned false for QWebEngineHistoryItem since the check
for AbstractMetaAttributes::HasRejectedConstructor triggered
on WebEngineHistoryItem(QWebEngineHistoryItemPrivate *priv),
causing the function to bail out.
To prevent this, add a new
AbstractMetaAttributes::HasRejectedDefaultConstructor attribute
and use that in isValueTypeWithCopyConstructorOnly().
Task-number: PYSIDE-906
Change-Id: I4fee83b89f0a4c44e7e8d69e118ed7f2b03ceee1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Find the AbstractMetaEnum belonging to the type entry and perform some
checks. Generally do not use int for public enums. Warn when a
protected scoped enum is encountered as this cannot be converted.
Task-number: PYSIDE-817
Change-Id: I02b566093b331ea2ea627bf72964aad0a1a51c83
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add XML elements specifying an exception handling mode to type system,
complex type entries (classes) and function modifications.
From the mode and the exception specification as detected
by Clang, deduce whether to generate try/catch code.
Task-number: PYSIDE-62
Change-Id: Ib76adc21cefd81bf9f82f819a3c151056c33a3b7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When trying to specify the base class
template<int R, int C> QGenericMatrix of the QMatrixRxN classes,
clashes of the SBK..IDX enumeration values occurred since
the integers were not part of the type name.
Fix that by dynamically adding dummy entries of
EnumValueTypeEntry for the integer values encountered on the fly.
Task-number: PYSIDE-725
Change-Id: Ie6b4489b5293e04b7c2c76861341c99b136cd558
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
| |
sources/shiboken2/tests/libsample/objecttype.cpp:283:17: warning: unused variable 'fake_child' [-Wunused-variable]
sources/shiboken2/ApiExtractor/doxygenparser.cpp:71:15: warning: unused variable 'numPrefixes' [-Wunused-variable]
Change-Id: I409f22e1450e9ae0f3f5924cb6dd47991d12a2ad
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QAbstractRayCaster is the first class in Qt to use type aliases:
using Hits = QVector<QRayCasterHit>;
Treat them as typedefs if a canonical type can be obtained for
them. This requires adding some simplification of the canonical types
obtained for standard containers.
Task-number: PYSIDE-751
Change-Id: I521a8b02d3c8cb89e4f72a817fbacc5955041570
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
| |
Task-number: PYSIDE-752
Change-Id: I88d8bf7598b9dc74adec9a4aaee8bd90db8ae6e9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
First encountered in:
QtScxmlEvent::setEventType(const EventType &);
The metatype was wrongly detected as NativePointerPattern
in AbstractMetaType::determineUsagePattern().
Introduce a helper for detecting plain const-ref and use
that consistently.
Change-Id: I6b105bc99ae63e4737c5d628e79f23b7acbcca3d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce enumeration for the type to EnumTypeEntry which can be specified
by the boolean "class" attribute. For the enum classes, the value names
need to be qualified by the enum name to match the C++ API.
For the C++ generator, add an overload to
Shiboken::createScopedEnumItem() that takes a PyTypeObject and add the enum
items to the enum so that the name is in the enum scope.
Change-Id: Ia0e469d13b08c196b9ddd965b9cf3cc62a38630b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Wrap value in int(), which is required for enum classes.
Add a compile test to libsample.
Task-number: PYSIDE-487
Change-Id: I78f07ae66da64caad1f75722308256e40e91eded
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|\
| |
| |
| | |
Change-Id: If56adeea2f888d8bc34e202b697f735508896c84
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The macOS 10.8, PySide2 branch 5.6 integrations were misteriously
failing with crashes on exit in the objecttype_test.py test, with a
stack trace similar to:
0x00007fff8899e90a _sigtramp + 26
0x0000000100784710 0x0 + 4302849808 (note the 0x0 address)
0x0000000100055408 dict_traverse + 168
0x0000000100107f77 collect + 407
0x00000001001089f4 PyGC_Collect + 52
0x00000001000ef503 Py_Finalize + 259
0x00000001000eefca handle_system_exit + 250
0x00000001000ef235 PyErr_PrintEx + 469
0x00000001000efebb PyRun_SimpleFileExFlags + 299
0x00000001001071dd Py_Main + 3101
Reproducing it on a CI VM was very difficult, requring dubious
manipulation of PATH, PYTHONPATH and LD_LIBRARY_PATH environment
variables. In the end the issue was diagnosed to be heap corruption,
and thus the difficulty in reproducing it.
The testParentFromCpp test in objecttype_test.py calls
the destroyCppParent method to delete its parent. Because
the deletion of the parent invokes the destructor ~ObjectType(), that
in turn deletes the child. This lead to head corruption, because
the child "o" by destroying its parent, destroys itself, and once
the "delete m_parent" is done, the next "m_parent = 0" would write
to invalid (freed) memory.
In a release build of the Python interpreter, this ends up in
accessing the freed memory in the GC collection phase (but under a
debugger this crashed in several other random places).
The fix is to delete the "m_parent = 0;" statement, so that nothing
is written to freed memory.
Change-Id: I2d7a41b99a3255ebb300e6157b3dd0d78eb27a54
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove the exclusion. Required for
Qt3dExtras::QAbstractCameraController::moveCamera() in 5.10.
Task-number: PYSIDE-487
Change-Id: I67ae24d4cda2d90ac30c97f77457c2eaf65099ab
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Replace virtual by override where appropriate to make the code
clearer.
Change-Id: I143daf29f1c162b2de959411a5f4acdc43a2b253
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Check the attributes and add test.
Change-Id: I6c3d76ed32b5d20b6940849dd4895f98abd62fca
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|\|
| |
| |
| | |
Change-Id: I79637555fbfbd596dee4313baf80149d03bb5206
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
shiboken used to generate richcompare methods for namespaces when
it contained free comparison operators for classes in that namespace,
resulting in compile errors. For example:
namespace Qt3DRender {
bool operator!=(const QGraphicsApiFilter &reference, const QGraphicsApiFilter &sample)
...
Add a check preventing that.
Task-number: PYSIDE-487
Change-Id: If2fa1de1bfb0fdc11c9415421dab0c7e13abc500
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I72583df407fc5b3caa8bf35fd997889a4ac86512
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
Add simple array converters giving access to NumPy arrays.
Task-number: PYSIDE-354
Task-number: PYSIDE-516
Change-Id: I2446b0f1ef98eaf12df95e4bd0e03d73e0cd7126
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The modification can be used to indicate that for example
int* is meant to be used as int[].
This is reflected in the NativePointerAsArrayPattern
usage pattern of AbstractMetaType.
Task-number: PYSIDE-354
Task-number: PYSIDE-516
Change-Id: Icaeb3cce4be9ce06caa2cab628d4e8fc1b684819
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|