aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-07-20 08:05:42 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-07-20 08:05:48 +0200
commit22db3abf70308a7152789c6f92b8be764e6c18b8 (patch)
treebed2f2304a605e760e314100719deaa56517a3f4 /sources
parente0e44f0fd5b05ee299bd4e377b0d4a302c442aae (diff)
parenta1b09497f2f198e6ea523637321a0e11fa310d9c (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'sources')
-rw-r--r--sources/pyside2/doc/codesnippets/doc/src/snippets/qquickview-ex.cpp67
-rw-r--r--sources/pyside2/doc/qtattributionsscannertorst.py4
-rw-r--r--sources/pyside2/libpyside/pysideqflags.cpp4
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp9
-rw-r--r--sources/shiboken2/libshiboken/basewrapper.cpp2
5 files changed, 77 insertions, 9 deletions
diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/qquickview-ex.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/qquickview-ex.cpp
new file mode 100644
index 000000000..380989e4e
--- /dev/null
+++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/qquickview-ex.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of Qt for Python.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [0]
+if __name__ == '__main__':
+ app = QGuiApplication(sys.argv)
+ view = QQuickView()
+ view.setResizeMode(QQuickView.SizeRootObjectToView)
+
+ qmlFile = os.path.join(os.path.dirname(__file__), 'view.qml')
+ view.setSource(QUrl.fromLocalFile(os.path.abspath(qmlFile)))
+ if view.status() == QQuickView.Error:
+ sys.exit(-1)
+ view.show()
+
+ app.exec_()
+ # Deleting the view before it goes out of scope is required to make
+ # sure all child QML instances are destroyed in the correct order.
+ del view
+//! [0]
diff --git a/sources/pyside2/doc/qtattributionsscannertorst.py b/sources/pyside2/doc/qtattributionsscannertorst.py
index 54982c1a0..46a3ecb66 100644
--- a/sources/pyside2/doc/qtattributionsscannertorst.py
+++ b/sources/pyside2/doc/qtattributionsscannertorst.py
@@ -55,10 +55,6 @@ rstHeader="""Licenses Used in Qt for Python
Qt for Python contains some code that is not provided under the
GNU Lesser General Public License (LGPL) or the Qt Commercial License,
but rather under specific licenses from the original authors.
-
-Qt for Python contains some code that is not provided under the
-GNU Lesser General Public License (LGPL) or the Qt Commercial License,
-but rather under specific licenses from the original authors.
The Qt Company gratefully acknowledges these and other contributions
to Qt for Python. We recommend that programs that use Qt for Python
also acknowledge these contributions, and quote these license
diff --git a/sources/pyside2/libpyside/pysideqflags.cpp b/sources/pyside2/libpyside/pysideqflags.cpp
index 11db70bb5..f4263403b 100644
--- a/sources/pyside2/libpyside/pysideqflags.cpp
+++ b/sources/pyside2/libpyside/pysideqflags.cpp
@@ -165,8 +165,8 @@ namespace QFlags
PyTypeObject *create(const char* name, PyType_Slot numberMethods[])
{
char qualname[200];
- strcpy(qualname, "PySide2.libpyside.");
- strcat(qualname, name);
+ // PYSIDE-747: Here we insert now the full class name.
+ strcpy(qualname, name);
// Careful: PyType_FromSpec does not allocate the string.
PyType_Spec *newspec = new PyType_Spec;
newspec->name = strdup(qualname);
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
index 568b5fd27..a9556fa4c 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
@@ -4483,8 +4483,13 @@ void CppGenerator::writeEnumInitialization(QTextStream& s, const AbstractMetaEnu
if (!cppEnum->isAnonymous()) {
FlagsTypeEntry* flags = enumTypeEntry->flags();
if (flags) {
- s << INDENT << cpythonTypeNameExt(flags) << " = PySide::QFlags::create(\"" << flags->flagsName() << "\", "
- << cpythonEnumName(cppEnum) << "_number_slots);" << endl;
+ // The following could probably be made nicer:
+ // We need 'flags->flagsName()' with the full module/class path.
+ QString fullPath = getClassTargetFullName(cppEnum);
+ fullPath.truncate(fullPath.lastIndexOf(QLatin1Char('.')) + 1);
+ s << INDENT << cpythonTypeNameExt(flags) << " = PySide::QFlags::create(\""
+ << fullPath << flags->flagsName() << "\", "
+ << cpythonEnumName(cppEnum) << "_number_slots);" << endl;
}
enumVarTypeObj = cpythonTypeNameExt(enumTypeEntry);
diff --git a/sources/shiboken2/libshiboken/basewrapper.cpp b/sources/shiboken2/libshiboken/basewrapper.cpp
index 122e60e41..43c162dec 100644
--- a/sources/shiboken2/libshiboken/basewrapper.cpp
+++ b/sources/shiboken2/libshiboken/basewrapper.cpp
@@ -1302,7 +1302,7 @@ void removeParent(SbkObject* child, bool giveOwnershipBack, bool keepReference)
ChildrenList& oldBrothers = pInfo->parent->d->parentInfo->children;
// Verify if this child is part of parent list
- ChildrenList::iterator iChild = std::find(oldBrothers.begin(), oldBrothers.end(), child);
+ auto iChild = oldBrothers.find(child);
if (iChild == oldBrothers.end())
return;