diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-06-11 12:47:05 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-06-11 12:47:05 +0200 |
commit | 73d0fe549b223aa16544d04754a3301f4640f6d6 (patch) | |
tree | c6f0ad1b372b7ff818b282335415f8ce737b39bd /sources | |
parent | 5c3002ebae8e31b3aa05a43e418b196653b041d6 (diff) | |
parent | f2e63d3588c8422d84d9ff5480427a83d68083bb (diff) |
Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I6cf604e1ae7234ce4f0d99169e9269a7dde07a4a
Diffstat (limited to 'sources')
-rw-r--r-- | sources/pyside2/PySide2/__init__.py.in | 3 | ||||
-rw-r--r-- | sources/pyside2/libpyside/pyside.cpp | 1 | ||||
-rw-r--r-- | sources/shiboken2/generator/shiboken2/shibokengenerator.cpp | 2 | ||||
-rw-r--r-- | sources/shiboken2/tests/libsample/pen.cpp | 4 | ||||
-rw-r--r-- | sources/shiboken2/tests/libsample/pen.h | 5 | ||||
-rw-r--r-- | sources/shiboken2/tests/samplebinding/pen_test.py | 2 | ||||
-rw-r--r-- | sources/shiboken2/tests/samplebinding/typesystem_sample.xml | 1 |
7 files changed, 16 insertions, 2 deletions
diff --git a/sources/pyside2/PySide2/__init__.py.in b/sources/pyside2/PySide2/__init__.py.in index 8013ac68a..f860c6ac9 100644 --- a/sources/pyside2/PySide2/__init__.py.in +++ b/sources/pyside2/PySide2/__init__.py.in @@ -12,6 +12,9 @@ __version_info__ = (@BINDING_API_MAJOR_VERSION@, @BINDING_API_MINOR_VERSION@, @B def _additional_dll_directories(package_dir): # Find shiboken2 relative to the package directory. root = os.path.dirname(package_dir) + # Check for a flat .zip as deployed by cx_free(PYSIDE-1257) + if root.endswith('.zip'): + return [] shiboken2 = os.path.join(root, 'shiboken2') if os.path.isdir(shiboken2): # Standard case, only shiboken2 is needed return [shiboken2] diff --git a/sources/pyside2/libpyside/pyside.cpp b/sources/pyside2/libpyside/pyside.cpp index aa0833d67..4a554de58 100644 --- a/sources/pyside2/libpyside/pyside.cpp +++ b/sources/pyside2/libpyside/pyside.cpp @@ -320,7 +320,6 @@ PyObject *getMetaDataFromQObject(QObject *cppSelf, PyObject *self, PyObject *nam Py_DECREF(attr); if (!value) return 0; - Py_INCREF(value); attr = value; } diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp index 0e8809e97..fe0d2765c 100644 --- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp @@ -557,7 +557,7 @@ QString ShibokenGenerator::guessScopeForDefaultValue(const AbstractMetaFunction { QString value = arg->defaultValueExpression(); - if (value.isEmpty() + if (value.isEmpty() || value == QLatin1String("{}") || arg->hasModifiedDefaultValueExpression() || isPointer(arg->type())) { return value; diff --git a/sources/shiboken2/tests/libsample/pen.cpp b/sources/shiboken2/tests/libsample/pen.cpp index d30071f49..b08721f79 100644 --- a/sources/shiboken2/tests/libsample/pen.cpp +++ b/sources/shiboken2/tests/libsample/pen.cpp @@ -65,3 +65,7 @@ int Pen::ctorType() { return m_ctor; } + +void Pen::drawLine(int x1, int y1, int x2, int y2, RenderHints renderHints) +{ +} diff --git a/sources/shiboken2/tests/libsample/pen.h b/sources/shiboken2/tests/libsample/pen.h index ca079198b..6b3bf9f1a 100644 --- a/sources/shiboken2/tests/libsample/pen.h +++ b/sources/shiboken2/tests/libsample/pen.h @@ -49,11 +49,16 @@ class LIBSAMPLE_API Pen public: enum { EmptyCtor, EnumCtor, ColorCtor, CopyCtor }; + enum RenderHints { None = 0, Antialiasing = 0x1, TextAntialiasing = 0x2 }; + Pen(); Pen(SampleNamespace::Option option); Pen(const Color& color); Pen(const Pen& pen); + // PYSIDE-1325, default initializer + void drawLine(int x1, int y1, int x2, int y2, RenderHints renderHints = {}); + int ctorType(); private: int m_ctor; diff --git a/sources/shiboken2/tests/samplebinding/pen_test.py b/sources/shiboken2/tests/samplebinding/pen_test.py index 408871bb3..89abf4d54 100644 --- a/sources/shiboken2/tests/samplebinding/pen_test.py +++ b/sources/shiboken2/tests/samplebinding/pen_test.py @@ -63,6 +63,8 @@ class TestPen(unittest.TestCase): def testPenWithIntConvertedToColor(self): pen = Pen(1) self.assertEqual(pen.ctorType(), Pen.ColorCtor) + pen.drawLine(0, 0, 5, 5) + if __name__ == '__main__': unittest.main() diff --git a/sources/shiboken2/tests/samplebinding/typesystem_sample.xml b/sources/shiboken2/tests/samplebinding/typesystem_sample.xml index 32df8fd7b..3cd318ceb 100644 --- a/sources/shiboken2/tests/samplebinding/typesystem_sample.xml +++ b/sources/shiboken2/tests/samplebinding/typesystem_sample.xml @@ -2321,6 +2321,7 @@ <value-type name="Color" /> <value-type name="Pen"> <enum-type identified-by-value="EnumCtor"/> + <enum-type name="RenderHints"/> </value-type> <value-type name="CtorConvRule"> |