| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Adapt CMake files, build scripts, tests and examples.
Task-number: PYSIDE-904
Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
It will be assumed that Python is always Python 3.
All checks for Python 2 are removed.
This is the second part of cleaning up the C code
from references to Python 2.
Task-number: PYSIDE-904
Change-Id: I3006412c2a5bb65402101b0aac5a5f2fc79ce2f8
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After implementing property objects for PySide, the static
properties (properties for static functions) were quite missing,
for instance from QtCore.QCoreApplication and
QtWidgets.QApplication .
This implementation uses the normal Python properties and derives
a PySide.ClassProperty class which works almost the same on classes.
The static methods had to be mutated to class methods explicitly.
That would be automated by PyType_Ready, but here we are doing this
after class initialization.
Task-number: PYSIDE-1019
Change-Id: Iabe00be18e25881cc7a97507b6fdae3e2d57ff7a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
| |
Build the QVariant from the QMetaType, fixing warning like:
libpyside/pysidemetafunction.cpp:186:64: warning: ‘Type’ is deprecated: Use QMetaType::Type instead. [-Wdeprecated-declarations]
/libpyside/pysidemetafunction.cpp:186:77: warning: ‘QVariant::QVariant(QVariant::Type)’ is deprecated: Use the constructor taking a QMetaType instead. [-Wdeprecated-declarations]
Change-Id: I5c9c4d775ef58ecf17326c112c5130c43fe1a09b
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
| |
Return the functions directly, fixing (g++ 9.3.0):
sources/pyside2/libpyside/pysideproperty.cpp:331:42: warning: offsetof within non-standard-layout type ‘PySidePropertyPrivate’ is conditionally-supported [-Winvalid-offsetof]
Pick-to: 5.15
Change-Id: I98f57d05c4c4163e06431c579537b4db01c656e6
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|\
| |
| |
| | |
Change-Id: I46f5d2dc758d0e1f23377c91ba7496793461771e
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
WAS: Feature-select: Use QtCore.Property instead of Python's property
When successfully trying to use QtCore.Property for feature-select's
property, I suddenly realized that the implementation only works with
QtCore derived classes.
This is the reworked version of Property that behaves correctly.
The exhaustive Python test was adapted and is used to check the full
compatibility of this implementation.
In a later update, this implementation might be changed to no longer
be restricted to QObject.
Change-Id: If87b7b633a2c45e23a15c4d956f63e21d33af3dd
Task-number: PYSIDE-1402
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|\|
| |
| |
| | |
Change-Id: I7f16e4f178bff9c37af3b7a9d536c5d6f42c66fb
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Static properties are not easy to support.
They need an extra property subtype and support in the meta-class.
A problem is that the implementation needs to go deeply into the
innards of things and need to use `_PyType_Lookup`.
That is hard to circumvent when the limited API is used.
Therefore, the current implementation will be it for 5.15 .
At most we might add a few missing properties through XML.
Task-number: PYSIDE-1019
Change-Id: I56a9eabe5f774c1ff04c149227e06318c8bf4f29
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I7b4ff138799ee81940c36e68a105cb42bb38a3ff
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For the 3 libraries that need to export symbols,
(libshiboken, libpyside, pysidetest), fix up the
export/import macros to follow the Qt convention:
- Define generic export/import macros LIBSHIBOKEN_EX/IMPORT equivalent
to Q_DECL_EX/IMPORT. Remove definitions for the ancient g++ 4.X.
- Reuse those in libpyside, pysidetest as PYSIDE_EX/IMPORT and
PYSIDETEST_EX/IMPORT.
- While building, define some BUILD_ macro indicating export.
- Define the _API macros depending on the BUILD_ macro to be export or
import, respectively as is done in Qt. Remove the ugly hack in
pysidetest that tried to re-use the PYSIDE_API macro.
- Brush up the headers a bit.
Change-Id: I635891b7eec5a52a1dcf45022f7bfb6a9cfee83f
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|\|
| |
| |
| | |
Change-Id: I13721e13d2fab13945385fe529afe4ab431e0532
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After implementing selectable features, support from the signature
module was quite much missing. It was not clear for some time what
to do the best.
It turned out to have the smallest impact and runtime penalty
to use the Python parser output dictionaries and create copies
with snake case naming. That has almost no overhead.
Also, it was necessary to augment the internal map_dict with
snake_case versions. It may be possible to simplify that map_dict
further in another check-in.
Remaining is the problem of static properties. This will be tried
using the PySide Property objects which can be improved.
Change-Id: Ied83ccb197a3c15932c4202b5f1ade772416e17b
Task-number: PYSIDE-1019
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|\|
| |
| |
| | |
Change-Id: Ie6da3938b82f5ebe96dd12bd65a3ccc4180d2fba
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The early signature module tried to minimize the visible
changes to the code base. It replaced the `PyType_Ready` call
by a special version which did other things as well.
We replace that special call by a more intuitive function
`InitSignatureStrings` that does exactly that and nothing more.
The functionality of the module is unchanged.
Change-Id: Ic2f9cd29b0352f0a24daa55b01420c77d103c0b2
Task-number: PYSIDE-510
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|\|
| |
| |
| | |
Change-Id: Id0fc76666bbdb254a833eeb6909a0874b2611bf3
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The `__get__` method gets created by `PyType_Ready` when
the slot `tp_descr_get` is set in the signal class.
Change-Id: Id853c59546c0382afeda837f0abfd596b6ca5c7f
Fixes: PYSIDE-68
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|\|
| |
| |
| | |
Change-Id: Ia31df23a16575f9ecefe13ec85fb70197d103278
|
| |
| |
| |
| |
| |
| | |
Task-number: PYSIDE-68
Change-Id: I8245260cadf6c71167bff51829f2851ab8403248
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I8aa48d07067c45c888c73af87314f6a88c2a6e14
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
QtCore uses QSettings to read the qt.conf file, which uses
Latin1 encoding in Qt 5.
To match this, use Latin1 encoding for the embedded qt.conf as well,
which at least improves the situation for latin characters.
Non-latin characters are unfortunately non-fixable in Qt 5.
Task-number: PYSIDE-972
Change-Id: Ie9c77029327c3531d3491138d826b221497a9119
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This feature is now almost fully implemented.
TODO: Static properties like `QtWidgets.QApplication.platformName` are
skipped for now. They need support by the meta class.
Maybe this is a reason to use QtCore.Property instead of vanilla
Python property and improve it.
With the new infrastructure, we can also consider to add properties
which have no equivalent in the Qt implementation. A prominent
example is "central_widget".
Change-Id: Ia0e32e41de8ab72e3bba74878e61bcbac6da50ea
Task-number: PYSIDE-1019
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I114a003e36bbe9eb7452f13c1515e3419648e228
|
| |
| |
| |
| |
| | |
Change-Id: Id7e1a4f9f938f9b86e1e905936b78c1531f5a566
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|\|
| |
| |
| | |
Change-Id: Ib1d2c1b76a043526e8f715e45296104cad085a4a
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch is based upon the old PYSIDE-198 proposal.
It worked with a few changes on Python 3 with limited API disabled.
When enabling the Limited API, there were a lot of crashes. This was
due to the way we need to get around access to certain implementations.
This showed that the original patch was wrong in the expression of
bindingmanager.cpp
bool isCompiled = !isMethod && Py_TYPE(method)->tp_call != nullptr;
After fixing this expression with
bool isCompiled = !isMethod && Py_TYPE(method) != &PyCFunction_Type
&& Py_TYPE(method)->tp_call != nullptr;
everything worked fine with the Limited API, too.
Fixes: PYSIDE-198
Task-number: PYSIDE-829
Change-Id: I4f887c639628041682052e90ba4c72aa98284e9e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As a drive by, adapt to changed values of QMetaObject::Call.
Task-number: PYSIDE-1339
Task-number: PYSIDE-904
Change-Id: Ic55a5da910c9ef022af3dedf749f80153f519ebf
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| | |
Task-number: PYSIDE-1339
Task-number: PYSIDE-904
Change-Id: I7e4ffaeabb2ac8a5ffe165d43b3475a7e5d57447
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|\|
| |
| |
| | |
Change-Id: I747d25be8a1d6d45f14c8ae1d04c252e1f3a6b59
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When determinating the type name for Signal types,
we have special treatment for a couple of Python types
like str, int, float, bool, etc, if the current type
is none of those, we return a generic 'PyObject',
which in most cases works, but not for specific interaction
with WebChannel.
Emiting one of the previous types works out of the box,
but when using:
... = Signal(list)
we get a message stating:
> js: Uncaught TypeError: Cannot read property '0' of null
meaning that list was not really passed correctly.
The solution for this is to use:
... = Signal('QVariantList')
but as a string, not type.
Passing a string means that we will return the same type as string
from the getTypeName function, so this patch adds a condition
to treat Signal(list) as a Signal('QVariantList').
We were using this workaround for some bugs related to QtWebKit,
so it was accepted as solution.
Fixes: PYSIDE-981
Change-Id: I06720ca62426d51decc2ab08d380f7f967460788
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Removal of the statemachine framework from QtCore
- Addition of QAbstractFileIconProvider
- Adapt some signatures
- QMetaType deprecations
Change-Id: Ia51354542ad1d2f0bb5530e45ebef0d6ccdb633d
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|\|
| |
| |
| | |
Change-Id: Icf4b3535be52b64ef15eced7103bb1280e031e30
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This was merged with "WIP: Enable support for Python 3.9".
There were minor problems, only.
Thanks Cristian for adding cosmetic changes which should already
have been applied in Python 3.8 or earlier.
Change-Id: Id5e8696d9cfb7192243ad44c93e9f2cf347d6a7c
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
After qtbase/37f2007d49cf24cc05b95d3ce70d3494050eb822,
stream operators will be registered automatically.
Change-Id: I46a161d6c664786849fa1d78cd8e6a095dd371f0
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Adapt to qtbase/2f9a294252ae44defd4d8ae1b3c09d8e36ee0612:
- Removal of deprecated QSettings API
- Changed signature of QLineF
- Change of QVariant constructors
- Introduction of new QIODeviceBase class
Task-number: PYSIDE-1339
Task-number: PYSIDE-904
Change-Id: I834f535af3c977164def12fc86dfd87282c240aa
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|\|
| |
| |
| | |
Change-Id: Icee2cd5a37181070d8ef50e7143868d4f126cea5
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Feature switching was written rather naively and happened after
almost every module change which can occour very often.
This patch is much more careful with switching and uses an ignore
code to prevent switching when PySide was not imported at all.
A potential regression when a switch is set before some PySide
module is being imported and PepType_SOTP is zero was also solved.
Task-number: PYSIDE-1019
Change-Id: I24dec7b3e4d0b577f77262392ded0b8a2006b3cc
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
** fix: MSVC needs extra sign bit in basewrapper_p.h! Buglet? **
The new feature selection has some tiny overhead.
It is about two dict accesses plus a slot access for every
tp_(get|set)attro call.
The introduction of an explicit `__init_feature__` call allows to
optimize this overhead very nicely, because this init is done for
each __feature__ import:
First, we can remove that tiny overhead completely by not initializing
the feature_select module at all if no __feature__ import is used.
Second, we can optimize this access further by caching the current module
dict. If the dict is unchanged, then the last select_id can be used.
This reduces the overhead of frequent calls to a single slot access.
Third, we finally cache the select id in unused SbkObjectType bits.
That removes the last structure where repeated attribute lookup is used.
The overhead is therefore quite small when something is changed.
But typically these changes are infrequent. The majority of accesses
do change nothing, and this case is now quite much optimized.
Change-Id: I7d1a4611a1c19216fd9be8f04457bb18ebd52ab1
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This change tries to make the selectable feature patch
better understandable.
If you know about anything that could help to clarify this
better, please help improving this by adding what is missing.
Change-Id: Iaf1664f8a703b2dc234df83814f6f4258fe14936
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|\|
| |
| |
| | |
Change-Id: Ib38f2f4be9f214df79454ff972ccd20fbfc6d1cd
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is the implementation of the first of a series of dynamically
selectable features.
The decision depends of the following setting at the beginning of
a module after PySide2 import:
from __feature__ import snake_case
For more info, see the Jira issue, section
The Principle Of Selectable Features In PySide
The crucial problems that are now solved were:
- it is not sufficient to patch a type dict, instead the whole
`tp_mro` must be walked to rename everything.
- tp_getattro must be changed for every existing type. This
is done either in shiboken by a changed PyObject_GenericGetAttr
or PyObject_SenericGetAttr, or in the generated tp_(get|set)attro
functions.
An example is included in sources/pyside2/doc/tutorial/expenses.
Task-number: PYSIDE-1019
Change-Id: I5f103190be2c884b0b4ad806187f3fef8e6598c9
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|/
|
|
|
|
|
|
|
|
|
| |
Extend the Quick register helper function by the bool creatable and
string noCreationReason parameters, extract a QML helper taking the same
parameters and add the overload.
Task-number: PYSIDE-574
Change-Id: I955dbd158c7b22d2637bbac464937f9fda6d7901
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The feature selection framework had a very early static
initialization from the early stages of the development.
Normally, Python is initialized before PySide gets loaded.
In case of scriptable application, this might not be so.
Actually this static initialization was no longer necessary
and was removed, as the bug was hopefully as well.
Change-Id: I2c703c9cac14b6093d0c43c4bae94ff2b29c0640
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the framework for selectable features.
There are no real features implemented.
Planned is a maximum of 8 features.
They are all implemented as a dummy for now.
The decision depends of the following setting at the beginning of
a module after PySide2 import:
from __feature__ import <feature name>
For more info, see the Jira issue, section
The Principle Of Selectable Features In PySide
Task-number: PYSIDE-1019
Change-Id: If355e9294b5c16090b39d30422a90ea9c8523390
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
| |
This is the proper type and makes it clear that it it is not related
to Qt's hash type (uint in Qt 5, size_t in Qt 6).
Task-number: PYSIDE-904
Change-Id: I4ce0f5c845c06e5dcd0ad9744a16a995017987ef
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
| |
Change-Id: I2463997f1eb2012cbbd0192a019ca57beaf55d5b
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
| |
Task-number: PYSIDE-904
Change-Id: I0280de35578f72ab4616170115c5afed9d6d7488
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implementation allows module-level and scoped QEnums
which are Python enum types. Scoped types are registered in Qt's meta
object system.
Usage of QEnum/QFlag with decorator or function call:
from enum import Enum, Flag, auto
from PySide2.QtCore import QEnum, QFlag, QObject
class Compass(QObject):
@QEnum
class Orientation(Enum):
North, East, South, West = range(4)
class Color(Flag):
RED = auto()
BLUE = auto()
GREEN = auto()
WHITE = RED | BLUE | GREEN
QFlag(Color)
Fixes: PYSIDE-957
Change-Id: Ie15f45cbd932c816b50724a96eee0c14ae1fdee8
Task-number: PYSIDE-487
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|\
| |
| |
| | |
Change-Id: I6cf604e1ae7234ce4f0d99169e9269a7dde07a4a
|