| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Apparently the necessary header is not always implicitly
included, so make it explicit.
Change-Id: I4e3a8b86139c7f9ce3cada43ee6e6827a3606fe3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
| |
This caused issues when trying to retrieve signals defined in QML,
apart from the fact that it caused undefined behavior.
Task-number: PYSIDE-484
Change-Id: I335e30bda2e293c60f9b4dc68e19b183a75a74be
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was reported that errorhandling in ‘signalmanager.cpp.in’ was wrong and PyErr_Restore
might cause a segfault.
I copied the error state into local variables in order to report the errors,
before the errType and errValue variables are garbage collected.
Task-number: PYSIDE-464
Change-Id: I220eb14a55c3de1ab225c0b45169ef2a76b5f599
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
| |
QmlContextWrapper has been moved to qv4context_p.h.
Task-number: PYSIDE-323
Change-Id: I047249680efe7f766278ac0280d741e4916d1f10
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
| |
Qt 5.8 headers fail to compile unless C++ 11 is set.
Task-number: PYSIDE-323
Change-Id: I95c88cda954bcec1f15121fc7b61e1ad6e4e3565
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the GlobalReceiverV2 instance did not check for the
occurrence of an error when calling its Python callback. This led to
to skipping all processing of QEvents as described in PYSIDE-478.
The fix is to check if a Python error ocurred, and print it (thus
handling it, and clearing the current active error).
Task-number: PYSIDE-360
Change-Id: Idc49dc6fc18da27e92043df8fbc46072efc73f72
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
| |
Change-Id: I16b214d4bf48f325788aa05aef5b00e335591248
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously when a signal was emitted by omitting default arguments,
PySide would complain that not enough arguments were given, because
only one of the signal overloads was considered for emission.
Fix consists in trying to find a signal overload which has the same
number of arguments as given to the emit statement, as well as being
marked as a cloned meta method (which for moc means a signal with
default arguments).
Task-number: PYSIDE-462
Change-Id: I0fc0f37bc7539a1357b8d3cda3155403fca4a763
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
SignalManager::callPythonMetaMethod"
The change should be reverted because the error conditions
are not clarified.
This reverts commit 1c9637a766a9ab9fc93259f2d19a6c11dd81121d.
Change-Id: Ieb3c47516590c44aae4e273de7cbc7eb7cb0f71d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
This is an obvious omission and easy to fix.
Thanks to Savin Zlobec for the patch.
You might consider to get a Jira account.
Task-number: PYSIDE-360
Change-Id: I7755f7846c39c9cd9b4d83991568b018223ee938
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The last improvement to signals and slots registration has removed
the problem that mixin classes were not handled the same as other classes.
The key idea was to use the MRO to inspect all involved classes
at type parsing time.
The signals and slots were then sorted in ‘updateMetaObject’.
The current patch enhances this solution in the following way:
In ‘parsePythonType’ we re-ordered the introspection loop in a way
that now all signals are extracted first. This way, they are ordered before
slots automatically, and a later sorting is not necessary. Furthermore,
instead of using qStableSort in ‘updateMetaObject’, we now check the
sorting only with ‘is_sorted’. If the sort order becomes invalid, it will issue a warning.
The latest change removes quadratic time behavior from the warning output.
Important notes and implications:
It is no longer relevant if slots are decorated with @QtCore.Slot().
Signals will work in normally created classes of all shapes.
If classes are modified later, they may grow an incompatibility
when signals appear after slots. Then you get a warning.
Adendum: It makes sense to use slots whenever possible. This way,
constructions as in static_metaobject_test.py work.
Now handling the warning correctly when it is turned into an error.
Correction: We leave the warning as-is and ignore the error!
Question: The static_metaobject_test.py passes its tests suddenly, when you use @Slot() !
Why? Should we open an extra issue for that?
Task-number: PYSIDE-315
Change-Id: I75c9c88787cd93251b1439db0088cd66fc0c3c97
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
| |
Some hack that makes CentOS happy.
Task-number: PYSIDE-342
Change-Id: Ibdc8ed09bf32c8788967b09bb0f816b604a00e76
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously when a python QObject-derived class was parsed, only
signals and slots from the top-level class were added to the
corresponding DynamicQMetaObject, and any signals or slots that
were defined in an inherited mixin class were registered at
signal connection time.
This caused issues with already existing connections because
registering new signals shifted all slot indices, thus breaking
the connections (no methods were called, or a wrong method was called
that caused a segmentation fault).
Fix consists in collecting and registering all signals, slots and
properties from a given class, including the mixin clases it derives
from, at type parsing time.
Important notes and implications:
All slots _must_ be decorated with @QtCore.Slot(), otherwise they
will not be registered at type parsing time, but at signal connection
time, and this _will_ cause hard-to-debug issues.
@QtCore.Slot() is not needed for lambdas or free functions, because
those get their own DynamicQMetaObject / QObject pair (via a
GlobalReceiver instance).
Dynamic addition or removal of signals and slots in most situations
will not work (e.g. existing connections will break, QML engine
heavily caches all method indices, and thus will also break).
Task-number: PYSIDE-315
Change-Id: I6213f53653566bde60a469cd239baf969b831560
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There has been an over-done correction in this issue.
The issue was solved, but I also “corrected” the function “getFromType”:
- I added a check for a valid object. This was wrong, it is allowed to return
a null object.
- I adjusted the refcount, because PyDict_GetItem returns a borrowed ref.
But this was correct, since the caller added a reference.
I have run all tests. The result is identical before and after my change.
It was necessary to treat this case before the end of PYSIDE-315, because
the new test code from Mingxiang of today hits exactly this bug.
Task-number: PYSIDE-79
Task-number: PYSIDE-315
Change-Id: Id489e106a5ee7410ed32b5c4bd21d4b98e4e97a7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
| |
Split into branches for too many/too few and subtract return type.
Task-number: PYSIDE-462
Change-Id: I25fbbd4fd18e87c7d9b3cb79b8c2c16e1e816fac
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
| |
Replace by C++ casts.
Change-Id: I8f4fe35a4e1529be307728258acf302e1eb9dfe5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The test used to fail with:
Traceback (most recent call last):
File "bug_722.py", line 47, in testQRealSignal
effect.blurRadiusChanged['qreal'].connect(foo1.setValue) # check if qreal is a valid type
IndexError: Signature blurRadiusChanged(qreal) not found for signal: blurRadiusChanged
The signatures changes from setBlurRadius(qreal) (Qt 4) to
setBlurRadius(double) (Qt 5) due to the metaobject resolving
types.
Task-number: PYSIDE-431
Change-Id: I240aac7adf34220a2e1016a0ba5ed78f5f51753b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use Shiboken::AutoDecRef::isNull() to fix MSVC error:
pyside2\libpyside\pysidesignal.cpp(409): error C2593: 'operator ==' is ambiguous
qtbase\include\qtcore\../../src/corelib/tools/qpoint.h(329): note: could be 'bool operator ==(const QPointF &,const QPointF &)'
qtbase\include\qtcore\../../src/corelib/tools/qpoint.h(149): note: or 'bool operator ==(const QPoint &,const QPoint &)'
...
Amends change 8726914a418462194a3fbd8187728f411fb70988.
Task-number: PYSIDE-79
Change-Id: I3cae3d9b0192a96ef718e4c4a151ff7ca2949858
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The multiple problems were caused by wrong or missing refcounts.
They led probably to the assumption that we need the garbage collector.
There is no garbage collector needed, since there exist no cyclic references.
Some increfs and decrefs were not correct, and a few special rules concerning
reference counting were ignored.
This is a final solution:
The case of a function call that returns a signal is special.
In this case, we keep track of the extra reference in a structure.
In all other cases there is a pre-existing object.
This patch is not creating any other errors.
It is no longer a hack but a true solution.
Added explicit path setting in order to circumvent the spurious python 2.7
error in disconnect_test.py .
Task-number: PYSIDE-79
Change-Id: I2579adf8fc671a2c2b665cfddaa26ecf96300a99
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a method is invoked recursively multiple times, it can exhaust
Python's stack depth limit, in which case an exception regarding that
limit is printed.
However the error message is not printed correctly, because
PyErr_Print itself tries to call Python code to normalize exceptions
if needed, which hits the stack depth limit issue again, and tries to
set the exception again, and fails.
This change makes sure to temporarily increase the stack limit, to allow
printing the exception message which says that the stack limit has been
reached.
Change-Id: I8eb086f9ad5b8712d348b6e894c2ef308f034528
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Whenever a connection is made to a valid method that was not yet
defined as a slot, the method will be marked as a slot before the
connection proceeds, thus the connection will succeed.
However when connecting using old style SLOT("method()") syntax,
it is possible to provide an invalid signature by specifying the
method name, but forgetting the parentheses.
In such a case, instead of failing and notifying the user, the
connection erroneously succeeded, and on signal emission would not
behave correctly.
This change makes sure to sanity check that dynamically added
signals and slots contain parentheses, thus not causing incorrect
connection creation.
Change-Id: Iaa1a85a2ce698ca31a99100e00b683cfa0cb33cc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_traverse' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_clear' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_richcompare' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_weaklistoffset' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_iter' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_iternext' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_methods' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_members' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_getset' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_base' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_dict' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_descr_get' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_descr_set' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_dictoffset' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_init' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_alloc' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_new' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_free' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_is_gc' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_bases' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_mro' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_cache' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_subclasses' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_weaklist' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_del' [-Wmissing-field-initializers]
pysideweakref.cpp:75:1: warning: missing initializer for member '_typeobject::tp_version_tag' [-Wmissing-field-initializers]
pysideweakref.cpp:77:91: warning: unused parameter 'kw' [-Wunused-parameter]
pysideqflags.cpp:59:77: warning: unused parameter 'kwds' [-Wunused-parameter]
pyside.cpp:214:72: warning: unused parameter ‘kwds’ [-Wunused-parameter]
void initQObjectSubType(SbkObjectType* type, PyObject* args, PyObject* kwds)
pysidemetafunction.cpp:108:1: warning: missing initializer for member '_typeobject::tp_version_tag' [-Wmissing-field-initializers]
pysidemetafunction.cpp:116:66: warning: unused parameter 'kw' [-Wunused-parameter]
pysideslot.cpp:112:1: warning: missing initializer for member '_typeobject::tp_version_tag' [-Wmissing-field-initializers]
pysideslot.cpp:157:62: warning: unused parameter 'kw' [-Wunused-parameter]
pysideclassinfo.cpp:105:1: warning: missing initializer for member '_typeobject::tp_version_tag' [-Wmissing-field-initializers]
pysideclassinfo.cpp:107:63: warning: unused parameter 'kw' [-Wunused-parameter]
pysideclassinfo.cpp:152:66: warning: unused parameter 'args' [-Wunused-parameter]
pysideclassinfo.cpp:152:82: warning: unused parameter 'kwds' [-Wunused-parameter]
pysideproperty.cpp:73:1: warning: missing initializer for member 'PyMethodDef::ml_doc' [-Wmissing-field-initializers]
pysideproperty.cpp:73:1: warning: missing initializer for member 'PyMethodDef::ml_doc' [-Wmissing-field-initializers]
pysideproperty.cpp:73:1: warning: missing initializer for member 'PyMethodDef::ml_doc' [-Wmissing-field-initializers]
pysideproperty.cpp:73:1: warning: missing initializer for member 'PyMethodDef::ml_doc' [-Wmissing-field-initializers]
pysideproperty.cpp:73:1: warning: missing initializer for member 'PyMethodDef::ml_meth' [-Wmissing-field-initializers]
pysideproperty.cpp:73:1: warning: missing initializer for member 'PyMethodDef::ml_flags' [-Wmissing-field-initializers]
pysideproperty.cpp:73:1: warning: missing initializer for member 'PyMethodDef::ml_doc' [-Wmissing-field-initializers]
pysideproperty.cpp:122:1: warning: missing initializer for member '_typeobject::tp_version_tag' [-Wmissing-field-initializers]
pysideproperty.cpp:174:66: warning: unused parameter 'args' [-Wunused-parameter]
pysideproperty.cpp:174:82: warning: unused parameter 'kwds' [-Wunused-parameter]
pysideproperty.cpp:237:67: warning: unused parameter 'kw' [-Wunused-parameter]
pysideproperty.cpp:441:39: warning: unused parameter 'self' [-Wunused-parameter]
pysidesignal.cpp:93:1: warning: missing initializer for member 'PyMethodDef::ml_meth' [-Wmissing-field-initializers]
pysidesignal.cpp:93:1: warning: missing initializer for member 'PyMethodDef::ml_flags' [-Wmissing-field-initializers]
pysidesignal.cpp:93:1: warning: missing initializer for member 'PyMethodDef::ml_doc' [-Wmissing-field-initializers]
pysidesignal.cpp:127:1: warning: missing initializer for member '_typeobject::tp_dict' [-Wmissing-field-initializers]
pysidesignal.cpp:127:1: warning: missing initializer for member '_typeobject::tp_descr_get' [-Wmissing-field-initializers]
pysidesignal.cpp:127:1: warning: missing initializer for member '_typeobject::tp_descr_set' [-Wmissing-field-initializers]
pysidesignal.cpp:127:1: warning: missing initializer for member '_typeobject::tp_dictoffset' [-Wmissing-field-initializers]
pysidesignal.cpp:127:1: warning: missing initializer for member '_typeobject::tp_init' [-Wmissing-field-initializers]
pysidesignal.cpp:127:1: warning: missing initializer for member '_typeobject::tp_alloc' [-Wmissing-field-initializers]
pysidesignal.cpp:127:1: warning: missing initializer for member '_typeobject::tp_new' [-Wmissing-field-initializers]
pysidesignal.cpp:127:1: warning: missing initializer for member '_typeobject::tp_free' [-Wmissing-field-initializers]
pysidesignal.cpp:127:1: warning: missing initializer for member '_typeobject::tp_is_gc' [-Wmissing-field-initializers]
pysidesignal.cpp:127:1: warning: missing initializer for member '_typeobject::tp_bases' [-Wmissing-field-initializers]
pysidesignal.cpp:127:1: warning: missing initializer for member '_typeobject::tp_mro' [-Wmissing-field-initializers]
pysidesignal.cpp:127:1: warning: missing initializer for member '_typeobject::tp_cache' [-Wmissing-field-initializers]
pysidesignal.cpp:127:1: warning: missing initializer for member '_typeobject::tp_subclasses' [-Wmissing-field-initializers]
pysidesignal.cpp:127:1: warning: missing initializer for member '_typeobject::tp_weaklist' [-Wmissing-field-initializers]
pysidesignal.cpp:127:1: warning: missing initializer for member '_typeobject::tp_del' [-Wmissing-field-initializers]
pysidesignal.cpp:127:1: warning: missing initializer for member '_typeobject::tp_version_tag' [-Wmissing-field-initializers]
pysidesignal.cpp:176:1: warning: missing initializer for member '_typeobject::tp_version_tag' [-Wmissing-field-initializers]
pysidesignal.cpp:183:1: warning: missing initializer for member 'PyMethodDef::ml_meth' [-Wmissing-field-initializers]
pysidesignal.cpp:183:1: warning: missing initializer for member 'PyMethodDef::ml_flags' [-Wmissing-field-initializers]
pysidesignal.cpp:183:1: warning: missing initializer for member 'PyMethodDef::ml_doc' [-Wmissing-field-initializers]
pysidesignal.cpp:238:1: warning: missing initializer for member '_typeobject::tp_version_tag' [-Wmissing-field-initializers]
pysidesignal.cpp:525:44: warning: unused parameter 'klass' [-Wunused-parameter]
pysidesignal.cpp:796:70: warning: unused parameter 'sig2' [-Wunused-parameter]
Change-Id: I61758b0a9b99122847fcb9e5584bce43bf83b692
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
| |
Change-Id: I033d18c3a822e172c14e0c525126847599e23ec4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
| |
Task-number: PYSIDE-355
Change-Id: I67366fb8ceacbcda80e7f17ad5e5ca80d6847902
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
| |
Task-number: PYSIDE-431
Change-Id: I981ba7622e6337b2e82f34831f529bfee405cc7e
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When Python parses a class to find signals and slots, the resulting
list contains the methods in the order they are defined in the source
code. After that, properties are parsed, and the notify ids are set
based on the relative order of the parsed methods.
But because the methods are sorted before their details are put into
the dynamic QMetaObject, the notify id of a property might point to
a wrong method.
This fix makes sure that the relative notify id of every property is
recomputed before being written to the QMetaObject. This allows
QML bindings to work correctly.
Change-Id: I5e50970fee9a42ae8ea551b7891d396b8a6eda97
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
| |
Change-Id: I4b14c2a423b3b3860ef79dd71c93c16b354e9e86
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
| |
Change-Id: I02b7ff8c1b1dc1e5eac4f1d39b5dabc09143e27c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
| |
Change-Id: I22ba07f83b5298385ca6a05cd0c02895aa1c8284
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
Use const reference and use iterators instead of looping
over QMap::values().
Change-Id: I0ab2f1ac9255959c482697e832cea1b7d3c09a30
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
| |
Add the define in CMakeLists.txt to enforce it in the module.
Change-Id: I430f094400b5a0b6af4e0df564f903e767986b63
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When SignalManager is being destructed and calls qDeleteAll on the
map of global receivers, a deletion of one receiver might indirectly
cause another receiver to be deleted. This will cause a double
delete when qDeleteAll tries to delete the already deleted second
receiver.
Fix this by deleting the first map element in a loop while the map
is not empty. This makes sure that if an indirect delete does happen,
it won't invalidate any iterator, because we call begin() again to
get a new iterator.
Task-number: PYSIDE-88
Change-Id: I9e812271c1a86607094006bc01eb55c930d7fa95
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Set the dynamic slot member m_data to 0 before deleting it and bail
out of qt_metacall() if that is the case.
This prevents a crash when the object is deleted by this if the last
reference was held by it.
Task-number: PYSIDE-88
Change-Id: Iaf173f1305c92861425af2c6447a6aab99451634
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
| |
This allows quickly opening python files (examples, tests, setup.py)
using the Qt Creator locator feature, when the pysidebindings
CMakeLists file is opened as a CMake project in Qt Creator.
Change-Id: I7aec8d387710a75a83b442b958322a1dc9ac79ec
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pyside2/libpyside/dynamicqmetaobject_p.h: In constructor 'PySide::MethodData::MethodData(QMetaMethod::MethodType, const QByteArray&, const QByteArray&)':
pyside2/libpyside/dynamicqmetaobject_p.h:60:33: warning: 'PySide::MethodData::m_mtype' will be initialized after [-Wreorder]
pyside2/libpyside/dynamicqmetaobject_p.h:58:20: warning: 'QByteArray PySide::MethodData::m_signature' [-Wreorder]
pyside2/libpyside/dynamicqmetaobject.cpp:277:1: warning: when initialized here [-Wreorder]
pyside2/libpyside/dynamicqmetaobject.cpp: In member function 'int PySide::DynamicQMetaObject::DynamicQMetaObjectPrivate::createMetaData(QMetaObject*, QLinkedList<QByteArray>&)':
pyside2/libpyside/dynamicqmetaobject.cpp:628:22: warning: narrowing conversion of 'n_info' from 'uint {aka unsigned int}' to 'int' inside { } is ill-formed in C++11 [-Wnarrowing]
pyside2/libpyside/dynamicqmetaobject.cpp:628:22: warning: narrowing conversion of 'n_methods' from 'uint {aka unsigned int}' to 'int' inside { } is ill-formed in C++11 [-Wnarrowing]
pyside2/libpyside/dynamicqmetaobject.cpp:628:22: warning: narrowing conversion of 'n_properties' from 'uint {aka unsigned int}' to 'int' inside { } is ill-formed in C++11 [-Wnarrowing]
pyside2/libpyside/dynamicqmetaobject.cpp:618:10: warning: unused variable 'n_signal' [-Wunused-variable]
pyside2/libpyside/pysideproperty.cpp:114:11: warning: enumeration value 'IndexOfMethod' not handled in switch [-Wswitch]
pyside2/libpyside/pysideproperty.cpp:114:11: warning: enumeration value 'RegisterPropertyMetaType' not handled in switch [-Wswitch]
pyside2/libpyside/pysideproperty.cpp:114:11: warning: enumeration value 'RegisterMethodArgumentMetaType' not handled in switch [-Wswitch]
Task-number: PYSIDE-339
Change-Id: I9fa95e520574549cfa1cdb5215fea1b6669fddd6
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously if a property was defined in python code, libPySide would
register the wrong type id inside the QMetaObject.d.data struct,
specifically it would straight away try to register the type as a
*new* type, without checking if it is a built-in type.
This led to setters not working on the respective property, because
the QVariant which stored the new value, could not be converted to
the type which QMetaObject reported.
Fix consists in checking if the specified property type is a built-in
one, and use it, or register the type as a new one, and make sure
it is tagged as a so-far unresolved type, which will be resolved
later upon access of the property.
Change-Id: Ie5e78a5e760682ce5a98dea138b16354b51c17ae
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PySide2/QtTest/typesystem_test.xml
2. Also fixed typo: Qt5Webkit -> Qt5WebKit
3. fixed global.h.in (@Qt5WebEngine_FOUND@ should be @Qt5WebEngineWidgets_FOUND@)
4. And fixed a couple of crash (more condition check).
`Scanning dependencies of target QtTest
[ 82%] Building CXX object PySide2/QtTest/CMakeFiles/QtTest.dir/PySide2/QtTest/qtest_pysideqtoucheventsequence_wrapper.cpp.o
[ 82%] Building CXX object PySide2/QtTest/CMakeFiles/QtTest.dir/PySide2/QtTest/qtest_wrapper.cpp.o
/Volumes/data2/mayadev/pyside/2.0qt56/pyside2-setup/pyside_build/py2.7-qt5.6.0-64bit-release/pyside2/PySide2/QtTest/PySide2/QtTest/qtest_wrapper.cpp:3836:40: error: expected ';' after top
level declarator
static PyObject* Sbk_QTestFunc_toString(PyObject* self, PyObject* pyArg)
^
;
/Volumes/data2/mayadev/pyside/2.0qt56/pyside2-setup/pyside_build/py2.7-qt5.6.0-64bit-release/pyside2/PySide2/QtTest/PySide2/QtTest/qtest_wrapper.cpp:4120:7: error: unexpected namespace name
'QTest': expected expression
::QTest* cppSelf = 0;
^
/Volumes/data2/mayadev/pyside/2.0qt56/pyside2-setup/pyside_build/py2.7-qt5.6.0-64bit-release/pyside2/PySide2/QtTest/PySide2/QtTest/qtest_wrapper.cpp:4120:14: error: use of undeclared
identifier 'cppSelf'
::QTest* cppSelf = 0;
^
/Volumes/data2/mayadev/pyside/2.0qt56/pyside2-setup/pyside_build/py2.7-qt5.6.0-64bit-release/pyside2/PySide2/QtTest/PySide2/QtTest/qtest_wrapper.cpp:4121:16: error: use of undeclared
identifier 'cppSelf'
SBK_UNUSED(cppSelf)
^
/Volumes/data2/mayadev/pyside/2.0qt56/pyside2-setup/pyside_install/py2.7-qt5.6.0-64bit-release/include/shiboken2/helper.h:31:31: note: expanded from macro 'SBK_UNUSED'
#define SBK_UNUSED(x) (void)x;
^
/Volumes/data2/mayadev/pyside/2.0qt56/pyside2-setup/pyside_build/py2.7-qt5.6.0-64bit-release/pyside2/PySide2/QtTest/PySide2/QtTest/qtest_wrapper.cpp:4124:5: error: use of undeclared
identifier 'cppSelf'
cppSelf = ;
^
/Volumes/data2/mayadev/pyside/2.0qt56/pyside2-setup/pyside_build/py2.7-qt5.6.0-64bit-release/pyside2/PySide2/QtTest/PySide2/QtTest/qtest_wrapper.cpp:4124:15: error: expected expression
cppSelf = ;
`
The toString and toString errors are caused by changes in QtTest/qtestcase.h
#define QTEST_COMPARE_DECL(KLASS)\
template<> Q_TESTLIB_EXPORT char *toString(const KLASS &);
Qt 5.6 has the following new lines in qtestcase.h:
QTEST_COMPARE_DECL(signed char)
QTEST_COMPARE_DECL(unsigned char)
shiboken picked up the new functions in Qt 5.6
These 2 new functions could be suppressed by editing PySide2/QtTest/typesystem_test.xml
|
| |
|
|
|
|
|
|
|
|
| |
1. Heap namespace has been introduced in Qt 5.5.0.
2. Throw methods have been moved from ExecutionContext to ExecutionEngine in Qt 5.5.0.
Source 1: https://github.com/qtproject/qtdeclarative/commit/84aae25c0b3003fb846568cf26a2c7150db14d9d
Source 2: https://github.com/qtproject/qtdeclarative/commit/486948817b26da2c62802bb93a0f671715c609d4
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Fix segfault when disconnecting signal on deleted object
|
| |\
| | |
| | |
| | |
| | |
| | |
| | | |
https://codereview.qt-project.org/pyside/pyside into deleted-obj-signal-segfault
From this Gerrit patch:
https://codereview.qt-project.org/#/c/110414/
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When disconnecting a signal on object that has been destroyed the
disconnect call (Sbk_QObjectFunc_disconnect) fails and returns 0 with an
error set. The calling function (signalInstanceDisconnect) was
segfaulting because it decrements the reference count of the returned
value. As the Python error is already set it's sufficient for
signalInstanceDisconnect to return 0 in this case.
Change-Id: If857961c0d64360045c1f2ba5855881e2a9aae43
Task-number: PYSIDE-189
|
|\ \ \
| | | |
| | | | |
Fix use-after-free in QProperty
|
| |\ \ \
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | | |
https://codereview.qt-project.org/pyside/pyside into use-after-free
From this Gerrit patch:
https://codereview.qt-project.org/#/c/84452/
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
PropertyData::type() returns a new QByteArray (whose `data` is a
copy of the `char*` name of the property)
However the use of `type().data()` on the stack without saving
its reference means the `char*` returned by the `data()` method
is immediately deallocated in the the `~QByteArray` destructor.
(Detected by AddressSanitizer)
The attached patch fixes it by holding a reference to the
QByteArray returned by `type()` for the duration of the method call
Change-Id: Ia794a1215da7ba4bada19091e6d6acf3e6584c70
|
|\ \ \ \
| | | | |
| | | | | |
Fix deadlocks in some more places in signals
|