From d794b7a748b82daa1af2a32b4c6a02d12d7626dc Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Sun, 15 Jul 2018 15:43:10 +0200 Subject: Generate fully Qualified Names for Flags The flags structure should give correct full names. See the doc in the issue tracker. Task-number: PYSIDE-747 Change-Id: I6b5c602566d3e4b8a2a93e2522e92da956578b18 Reviewed-by: Friedemann Kleint --- sources/pyside2/libpyside/pysideqflags.cpp | 4 ++-- sources/shiboken2/generator/shiboken2/cppgenerator.cpp | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'sources') 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); -- cgit v1.2.3 From f8c557bd5ea4e8f645ace36dd2ac1f933ca673ba Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Thu, 19 Jul 2018 09:36:22 +0200 Subject: Doc: Remove repetitive text in the licenses page Change-Id: Ide68c9045413f26ad7d7fc781aef03d61ea99179 Reviewed-by: Friedemann Kleint --- sources/pyside2/doc/qtattributionsscannertorst.py | 4 ---- 1 file changed, 4 deletions(-) (limited to 'sources') 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 @@ -52,10 +52,6 @@ def indent(lines, indent): 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. -- cgit v1.2.3 From 004e75a96c61f4e9dd18030a5fae9a6190eb6879 Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Tue, 10 Jul 2018 14:27:29 +0200 Subject: Doc: Add snippet override for QQuickView Change-Id: I051ddcc61904f293ed0f21173e040f8c89e2232e Reviewed-by: Friedemann Kleint --- .../doc/src/snippets/qquickview-ex.cpp | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/pyside2/doc/codesnippets/doc/src/snippets/qquickview-ex.cpp (limited to 'sources') 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] -- cgit v1.2.3 From a1b09497f2f198e6ea523637321a0e11fa310d9c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 19 Jul 2018 13:40:34 +0200 Subject: libshiboken: Use std::set::find() instead of searching the set Task-number: PYSIDE-727 Change-Id: Ia79f34ed466eb7652946e49db6ef6db8dd9fa03d Reviewed-by: Alexandru Croitor --- sources/shiboken2/libshiboken/basewrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sources') 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; -- cgit v1.2.3