diff options
Diffstat (limited to 'src/gui')
62 files changed, 441 insertions, 314 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index a3f53e149b..46dec7f28d 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -654,7 +654,7 @@ void QAccessible::removeActivationObserver(ActivationObserver *observer) /*! If a QAccessibleInterface implementation exists for the given \a object, this function returns a pointer to the implementation; otherwise it - returns 0. + returns \nullptr. The function calls all installed factory functions (from most recently installed to least recently installed) until one is found @@ -770,7 +770,7 @@ QAccessible::Id QAccessible::uniqueId(QAccessibleInterface *iface) /*! Returns the QAccessibleInterface belonging to the \a id. - Returns 0 if the id is invalid. + Returns \nullptr if the id is invalid. */ QAccessibleInterface *QAccessible::accessibleInterface(Id id) { @@ -1119,7 +1119,7 @@ QAccessibleInterface *QAccessibleInterface::focusChild() const \fn QAccessibleInterface *QAccessibleInterface::childAt(int x, int y) const Returns the QAccessibleInterface of a child that contains the screen coordinates (\a x, \a y). - If there are no children at this position this function returns 0. + If there are no children at this position this function returns \nullptr. The returned accessible must be a child, but not necessarily a direct child. This function is only relyable for visible objects (invisible @@ -1139,7 +1139,7 @@ QAccessibleInterface *QAccessibleInterface::focusChild() const Returns the QAccessibleInterface of the parent in the accessible object hierarchy. - Returns 0 if no parent exists (e.g. for the top level application object). + Returns \nullptr if no parent exists (e.g. for the top level application object). \sa child() */ @@ -1150,7 +1150,7 @@ QAccessibleInterface *QAccessibleInterface::focusChild() const Returns the accessible child with index \a index. 0-based index. The number of children of an object can be checked with childCount. - Returns 0 when asking for an invalid child (e.g. when the child became invalid in the meantime). + Returns \nullptr when asking for an invalid child (e.g. when the child became invalid in the meantime). \sa childCount(), parent() */ @@ -1356,7 +1356,7 @@ QAccessibleEvent::~QAccessibleEvent() \internal Returns the uniqueId of the QAccessibleInterface represented by this event. - In case the object() function returns 0 this is the only way to access the + In case the object() function returns \nullptr, this is the only way to access the interface. */ QAccessible::Id QAccessibleEvent::uniqueId() const @@ -1786,7 +1786,7 @@ QAccessibleInterface *QAccessibleEvent::accessibleInterface() const (This means that at least one interface among the ancestors should return a valid QWindow pointer). - The default implementation returns 0. + The default implementation returns \nullptr. */ QWindow *QAccessibleInterface::window() const { diff --git a/src/gui/configure.json b/src/gui/configure.json index 89934c8f1d..70d0817791 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -239,7 +239,8 @@ "sources": [ { "type": "pkgConfig", "args": "freetype2" }, { "type": "freetype", "libs": "-lfreetype", "condition": "!config.wasm" }, - { "libs": "-s USE_FREETYPE=1", "condition": "config.wasm" } + { "libs": "-s USE_FREETYPE=1", "condition": "config.wasm" }, + { "libs": "-lfreetype" } ], "use": [ { "lib": "zlib", "condition": "features.system-zlib" } @@ -250,7 +251,7 @@ "test": { "tail": [ "#ifndef FC_RGBA_UNKNOWN", - "# error This version of fontconfig is tool old, it is missing the FC_RGBA_UNKNOWN define", + "# error This version of fontconfig is too old, it is missing the FC_RGBA_UNKNOWN define", "#endif" ], "main": [ @@ -1436,7 +1437,7 @@ }, "eglfs_x11": { "label": "EGLFS X11", - "condition": "features.eglfs && features.xcb && features.xcb-xlib && features.egl_x11", + "condition": "features.eglfs && features.xcb-xlib && features.egl_x11", "output": [ "privateFeature" ] }, "gif": { @@ -1569,7 +1570,6 @@ }, "xcb-xlib": { "label": "XCB Xlib", - "emitIf": "features.xcb", "condition": "features.xlib && libs.xcb_xlib", "output": [ "privateFeature" ] }, diff --git a/src/gui/doc/snippets/code/src_gui_math3d_qquaternion.cpp b/src/gui/doc/snippets/code/src_gui_math3d_qquaternion.cpp index b5cd00d5aa..8da438e3a7 100644 --- a/src/gui/doc/snippets/code/src_gui_math3d_qquaternion.cpp +++ b/src/gui/doc/snippets/code/src_gui_math3d_qquaternion.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $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 @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** 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$ ** diff --git a/src/gui/doc/snippets/code/src_gui_opengl_qopenglbuffer.cpp b/src/gui/doc/snippets/code/src_gui_opengl_qopenglbuffer.cpp index 4a4a6fe16d..57dc909598 100644 --- a/src/gui/doc/snippets/code/src_gui_opengl_qopenglbuffer.cpp +++ b/src/gui/doc/snippets/code/src_gui_opengl_qopenglbuffer.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $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 @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** 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$ ** diff --git a/src/gui/doc/snippets/code/src_gui_opengl_qopengldebug.cpp b/src/gui/doc/snippets/code/src_gui_opengl_qopengldebug.cpp index 4ab84deb3e..e82447a174 100644 --- a/src/gui/doc/snippets/code/src_gui_opengl_qopengldebug.cpp +++ b/src/gui/doc/snippets/code/src_gui_opengl_qopengldebug.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtWidgets module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $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 @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** "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$ ** diff --git a/src/gui/doc/snippets/code/src_gui_opengl_qopenglfunctions.cpp b/src/gui/doc/snippets/code/src_gui_opengl_qopenglfunctions.cpp index 68a20dcb7c..e072c110f2 100644 --- a/src/gui/doc/snippets/code/src_gui_opengl_qopenglfunctions.cpp +++ b/src/gui/doc/snippets/code/src_gui_opengl_qopenglfunctions.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $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 @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** "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$ ** diff --git a/src/gui/doc/snippets/code/src_gui_vulkan_qvulkanfunctions.cpp b/src/gui/doc/snippets/code/src_gui_vulkan_qvulkanfunctions.cpp index 77c5444df5..0d13873f38 100644 --- a/src/gui/doc/snippets/code/src_gui_vulkan_qvulkanfunctions.cpp +++ b/src/gui/doc/snippets/code/src_gui_vulkan_qvulkanfunctions.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $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 @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** 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$ ** diff --git a/src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp b/src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp index c4dd9fea18..14ef9ed2d4 100644 --- a/src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp +++ b/src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $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 @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** "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$ ** diff --git a/src/gui/doc/snippets/code/src_gui_vulkan_qvulkanwindow.cpp b/src/gui/doc/snippets/code/src_gui_vulkan_qvulkanwindow.cpp index 65eca4a77f..81d51233a3 100644 --- a/src/gui/doc/snippets/code/src_gui_vulkan_qvulkanwindow.cpp +++ b/src/gui/doc/snippets/code/src_gui_vulkan_qvulkanwindow.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $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 @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** "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$ ** diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 830a110d68..9897c3aa6f 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -113,7 +113,7 @@ QImageData::QImageData() \internal Creates a new image data. - Returns 0 if invalid parameters are give or anything else failed. + Returns \nullptr if invalid parameters are give or anything else failed. */ QImageData * QImageData::create(const QSize &size, QImage::Format format) { diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp index 7eede5ee26..2f2f85f68d 100644 --- a/src/gui/image/qpicture.cpp +++ b/src/gui/image/qpicture.cpp @@ -1866,7 +1866,7 @@ QList<QByteArray> QPictureIO::outputFormats() bool QPictureIO::read() { QFile file; - const char *picture_format; + QByteArray picture_format; QPictureHandler *h; if (d->iodev) { // read from io device @@ -1882,7 +1882,7 @@ bool QPictureIO::read() if (d->frmt.isEmpty()) { // Try to guess format picture_format = pictureFormat(d->iodev); // get picture format - if (!picture_format) { + if (picture_format.isEmpty()) { if (file.isOpen()) { // unknown format file.close(); d->iodev = 0; diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 4b2334ae52..ea6697cc39 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -714,8 +714,8 @@ QBitmap QPixmap::createMaskFromColor(const QColor &maskColor, Qt::MaskMode mode) control the conversion. Note that QPixmaps are automatically added to the QPixmapCache - when loaded from a file; the key used is internal and can not - be acquired. + when loaded from a file in main thread; the key used is internal + and cannot be acquired. \sa loadFromData(), {QPixmap#Reading and Writing Image Files}{Reading and Writing Image Files} @@ -729,6 +729,7 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers // Note: If no extension is provided, we try to match the // file against known plugin extensions if (info.completeSuffix().isEmpty() || info.exists()) { + const bool inGuiThread = qApp->thread() == QThread::currentThread(); QString key = QLatin1String("qt_pixmap") % info.absoluteFilePath() @@ -736,13 +737,14 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers % HexString<quint64>(info.size()) % HexString<uint>(data ? data->pixelType() : QPlatformPixmap::PixmapType); - if (QPixmapCache::find(key, this)) + if (inGuiThread && QPixmapCache::find(key, this)) return true; data = QPlatformPixmap::create(0, 0, data ? data->pixelType() : QPlatformPixmap::PixmapType); if (data->fromFile(fileName, format, flags)) { - QPixmapCache::insert(key, *this); + if (inGuiThread) + QPixmapCache::insert(key, *this); return true; } } diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index 8ae03d5d38..808037f434 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -233,8 +233,8 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scal png_uint_32 width; png_uint_32 height; - int bit_depth; - int color_type; + int bit_depth = 0; + int color_type = 0; png_bytep trans_alpha = 0; png_color_16p trans_color_p = 0; int num_trans; @@ -678,7 +678,7 @@ QImage::Format QPngHandlerPrivate::readImageFormat() { QImage::Format format = QImage::Format_Invalid; png_uint_32 width, height; - int bit_depth, color_type; + int bit_depth = 0, color_type = 0; png_colorp palette; int num_palette; png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); diff --git a/src/gui/image/qxbmhandler.cpp b/src/gui/image/qxbmhandler.cpp index 24d86e116d..7ba44049b4 100644 --- a/src/gui/image/qxbmhandler.cpp +++ b/src/gui/image/qxbmhandler.cpp @@ -97,6 +97,8 @@ static bool read_xbm_header(QIODevice *device, int& w, int& h) if (r1.indexIn(sbuf) == 0 && r2.indexIn(sbuf, r1.matchedLength()) == r1.matchedLength()) w = QByteArray(&buf[r1.matchedLength()]).trimmed().toInt(); + else + return false; // "#define .._height <num>" readBytes = device->readLine(buf, buflen); @@ -109,6 +111,8 @@ static bool read_xbm_header(QIODevice *device, int& w, int& h) if (r1.indexIn(sbuf) == 0 && r2.indexIn(sbuf, r1.matchedLength()) == r1.matchedLength()) h = QByteArray(&buf[r1.matchedLength()]).trimmed().toInt(); + else + return false; // format error if (w <= 0 || w > 32767 || h <= 0 || h > 32767) diff --git a/src/gui/itemmodels/qstandarditemmodel.cpp b/src/gui/itemmodels/qstandarditemmodel.cpp index 430ba152a9..7afad95bd9 100644 --- a/src/gui/itemmodels/qstandarditemmodel.cpp +++ b/src/gui/itemmodels/qstandarditemmodel.cpp @@ -879,8 +879,8 @@ QStandardItem::~QStandardItem() } /*! - Returns the item's parent item, or 0 if the item has no parent. - \note For toplevel items parent() returns 0. To receive toplevel + Returns the item's parent item, or \nullptr if the item has no parent. + \note For toplevel items parent() returns \nullptr. To receive toplevel item's parent use QStandardItemModel::invisibleRootItem() instead. \sa child(), QStandardItemModel::invisibleRootItem() @@ -1548,7 +1548,7 @@ QModelIndex QStandardItem::index() const Returns the QStandardItemModel that this item belongs to. If the item is not a child of another item that belongs to the model, this - function returns 0. + function returns \nullptr. \sa index() */ @@ -1865,7 +1865,7 @@ void QStandardItem::setChild(int row, int column, QStandardItem *item) /*! Returns the child item at (\a row, \a column) if one has been set; otherwise - returns 0. + returns \nullptr. \sa setChild(), takeChild(), parent() */ @@ -1881,7 +1881,7 @@ QStandardItem *QStandardItem::child(int row, int column) const /*! Removes the child item at (\a row, \a column) without deleting it, and returns a pointer to the item. If there was no child at the given location, then - this function returns 0. + this function returns \nullptr. Note that this function, unlike takeRow() and takeColumn(), does not affect the dimensions of the child table. @@ -2283,7 +2283,7 @@ void QStandardItemModel::clear() itemPrototype()), and set it in the parent item's child table, if no item already exists at that index. - If \a index is an invalid index, this function returns 0. + If \a index is an invalid index, this function returns \nullptr. \sa indexFromItem() */ @@ -2380,7 +2380,7 @@ void QStandardItemModel::setItem(int row, int column, QStandardItem *item) \since 4.2 Returns the item for the given \a row and \a column if one has been set; - otherwise returns 0. + otherwise returns \nullptr. \sa setItem(), takeItem(), itemFromIndex() */ @@ -2453,7 +2453,7 @@ void QStandardItemModel::setHorizontalHeaderItem(int column, QStandardItem *item \since 4.2 Returns the horizontal header item for \a column if one has been set; - otherwise returns 0. + otherwise returns \nullptr. \sa setHorizontalHeaderItem(), verticalHeaderItem() */ @@ -2509,7 +2509,7 @@ void QStandardItemModel::setVerticalHeaderItem(int row, QStandardItem *item) \since 4.2 Returns the vertical header item for row \a row if one has been set; - otherwise returns 0. + otherwise returns \nullptr. \sa setVerticalHeaderItem(), horizontalHeaderItem() */ diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 53d1ac1fc0..7123c4d8ba 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3072,7 +3072,7 @@ QDropEvent::~QDropEvent() /*! If the source of the drag operation is a widget in this application, this function returns that source; otherwise it - returns 0. The source of the operation is the first parameter to + returns \nullptr. The source of the operation is the first parameter to the QDrag object used instantiate the drag. This is useful if your widget needs special behavior when dragging @@ -3514,7 +3514,7 @@ QActionEvent::~QActionEvent() \fn QAction *QActionEvent::before() const If type() is \l ActionAdded, returns the action that should - appear before action(). If this function returns 0, the action + appear before action(). If this function returns \nullptr, the action should be appended to already existing actions on the same widget. diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index f4e2dda05a..fd01f8bb7b 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -3747,7 +3747,7 @@ Qt::LayoutDirection QGuiApplication::layoutDirection() Returns the active application override cursor. - This function returns 0 if no application cursor has been defined (i.e. the + This function returns \nullptr if no application cursor has been defined (i.e. the internal cursor stack is empty). \sa setOverrideCursor(), restoreOverrideCursor() @@ -3983,6 +3983,9 @@ void QGuiApplicationPrivate::notifyThemeChanged() !QCoreApplication::testAttribute(Qt::AA_SetPalette)) { clearPalette(); initPalette(); + emit qGuiApp->paletteChanged(*app_pal); + if (is_app_running && !is_app_closing) + sendApplicationPaletteChange(); } if (!(applicationResourceFlags & ApplicationFontExplicitlySet)) { QMutexLocker locker(&applicationFontMutex); @@ -3991,6 +3994,15 @@ void QGuiApplicationPrivate::notifyThemeChanged() } } +void QGuiApplicationPrivate::sendApplicationPaletteChange(bool toAllWidgets, const char *className) +{ + Q_UNUSED(toAllWidgets) + Q_UNUSED(className) + + QEvent event(QEvent::ApplicationPaletteChange); + QGuiApplication::sendEvent(QGuiApplication::instance(), &event); +} + #if QT_CONFIG(draganddrop) void QGuiApplicationPrivate::notifyDragStarted(const QDrag *drag) { diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index 79c1a1c820..042a36c31f 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -313,6 +313,7 @@ public: protected: virtual void notifyThemeChanged(); + virtual void sendApplicationPaletteChange(bool toAllWidgets = false, const char *className = nullptr); bool tryCloseRemainingWindows(QWindowList processedWindows); #if QT_CONFIG(draganddrop) virtual void notifyDragStarted(const QDrag *); diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp index a455aa639d..22e46e0851 100644 --- a/src/gui/kernel/qhighdpiscaling.cpp +++ b/src/gui/kernel/qhighdpiscaling.cpp @@ -313,9 +313,12 @@ void QHighDpiScaling::updateHighDpiScaling() } m_active = m_globalScalingActive || m_screenFactorSet || m_pixelDensityScalingActive; - QPlatformScreen *primaryScreen = QGuiApplication::primaryScreen()->handle(); - qreal sf = screenSubfactor(primaryScreen); - QDpi primaryDpi = primaryScreen->logicalDpi(); + QScreen *primaryScreen = QGuiApplication::primaryScreen(); + if (!primaryScreen) + return; + QPlatformScreen *platformScreen = primaryScreen->handle(); + qreal sf = screenSubfactor(platformScreen); + QDpi primaryDpi = platformScreen->logicalDpi(); m_logicalDpi = QDpi(primaryDpi.first / sf, primaryDpi.second / sf); } diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index c5d5490ea0..be04513de6 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -1118,7 +1118,7 @@ void QOpenGLContext::swapBuffers(QSurface *surface) /*! Resolves the function pointer to an OpenGL extension function, identified by \a procName - Returns 0 if no such function can be found. + Returns \nullptr if no such function can be found. */ QFunctionPointer QOpenGLContext::getProcAddress(const QByteArray &procName) const { diff --git a/src/gui/kernel/qplatformcursor.cpp b/src/gui/kernel/qplatformcursor.cpp index bab26f6028..76e38ab12d 100644 --- a/src/gui/kernel/qplatformcursor.cpp +++ b/src/gui/kernel/qplatformcursor.cpp @@ -84,7 +84,7 @@ QT_BEGIN_NAMESPACE \a windowCursor is a pointer to the QCursor that should be displayed. - To unset the cursor of \a window, 0 is passed. This means \a window does not have + To unset the cursor of \a window, \nullptr is passed. This means \a window does not have a cursor set and the cursor of a the first parent window which has a cursor explicitly set or the system default cursor should take effect. diff --git a/src/gui/kernel/qplatformgraphicsbuffer.cpp b/src/gui/kernel/qplatformgraphicsbuffer.cpp index cc01efd6db..d361a8fc12 100644 --- a/src/gui/kernel/qplatformgraphicsbuffer.cpp +++ b/src/gui/kernel/qplatformgraphicsbuffer.cpp @@ -237,7 +237,6 @@ uchar *QPlatformGraphicsBuffer::data() */ int QPlatformGraphicsBuffer::byteCount() const { - Q_ASSERT(isLocked() & SWReadAccess); return size().height() * bytesPerLine(); } diff --git a/src/gui/kernel/qplatformgraphicsbufferhelper.cpp b/src/gui/kernel/qplatformgraphicsbufferhelper.cpp index c98aead5c2..c67e6d15cb 100644 --- a/src/gui/kernel/qplatformgraphicsbufferhelper.cpp +++ b/src/gui/kernel/qplatformgraphicsbufferhelper.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtPlatformSupport module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/kernel/qplatformgraphicsbufferhelper.h b/src/gui/kernel/qplatformgraphicsbufferhelper.h index 6307f54a3e..bfe61713d4 100644 --- a/src/gui/kernel/qplatformgraphicsbufferhelper.h +++ b/src/gui/kernel/qplatformgraphicsbufferhelper.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtPlatformSupport module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index 6e285a8fa5..7d1fcd4eeb 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -350,7 +350,7 @@ void QPlatformIntegration::destroy() /*! Returns the platforms input context. - The default implementation returns 0, implying no input method support. + The default implementation returns \nullptr, implying no input method support. */ QPlatformInputContext *QPlatformIntegration::inputContext() const { diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp index 9614be7f3e..b7b312e89e 100644 --- a/src/gui/kernel/qplatformscreen.cpp +++ b/src/gui/kernel/qplatformscreen.cpp @@ -370,7 +370,7 @@ QString QPlatformScreen::serialNumber() const /*! Reimplement this function in subclass to return the cursor of the screen. - The default implementation returns 0. + The default implementation returns \nullptr. */ QPlatformCursor *QPlatformScreen::cursor() const { diff --git a/src/gui/kernel/qrasterwindow.cpp b/src/gui/kernel/qrasterwindow.cpp index c88654e794..70d87347c3 100644 --- a/src/gui/kernel/qrasterwindow.cpp +++ b/src/gui/kernel/qrasterwindow.cpp @@ -1,41 +1,41 @@ /**************************************************************************** - ** - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtGui module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** 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. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ #include "qrasterwindow.h" diff --git a/src/gui/kernel/qshapedpixmapdndwindow.cpp b/src/gui/kernel/qshapedpixmapdndwindow.cpp index 8509eb0961..1a85a5e853 100644 --- a/src/gui/kernel/qshapedpixmapdndwindow.cpp +++ b/src/gui/kernel/qshapedpixmapdndwindow.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/kernel/qshapedpixmapdndwindow_p.h b/src/gui/kernel/qshapedpixmapdndwindow_p.h index 072e7c6aea..d9a6ea4888 100644 --- a/src/gui/kernel/qshapedpixmapdndwindow_p.h +++ b/src/gui/kernel/qshapedpixmapdndwindow_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/kernel/qtestsupport_gui.cpp b/src/gui/kernel/qtestsupport_gui.cpp index 8a6f662274..7aad4d8c7d 100644 --- a/src/gui/kernel/qtestsupport_gui.cpp +++ b/src/gui/kernel/qtestsupport_gui.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtTest module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/kernel/qtestsupport_gui.h b/src/gui/kernel/qtestsupport_gui.h index 82a81e9214..1f0c4f0960 100644 --- a/src/gui/kernel/qtestsupport_gui.h +++ b/src/gui/kernel/qtestsupport_gui.h @@ -3,7 +3,7 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtTest module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 0f5873543b..f1e08826a8 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -2587,6 +2587,8 @@ void QWindowPrivate::maybeQuitOnLastWindowClosed() return; Q_Q(QWindow); + if (!q->isTopLevel()) + return; // Attempt to close the application only if this has WA_QuitOnClose set and a non-visible parent bool quitOnClose = QGuiApplication::quitOnLastWindowClosed() && !q->parent(); QWindowList list = QGuiApplication::topLevelWindows(); @@ -2643,7 +2645,7 @@ QOpenGLContext *QWindowPrivate::shareContext() const native window, or to embed a native window inside a QWindow. If foreign windows are not supported or embedding the native window - failed in the platform plugin, this function returns 0. + failed in the platform plugin, this function returns \nullptr. \note The resulting QWindow should not be used to manipulate the underlying native window (besides re-parenting), or to observe state changes of the diff --git a/src/gui/opengl/qopengl.cpp b/src/gui/opengl/qopengl.cpp index 3a476978e7..987cbe7c12 100644 --- a/src/gui/opengl/qopengl.cpp +++ b/src/gui/opengl/qopengl.cpp @@ -62,6 +62,10 @@ QT_BEGIN_NAMESPACE typedef const GLubyte * (QOPENGLF_APIENTRYP qt_glGetStringi)(GLenum, GLuint); #endif +#ifndef GL_CONTEXT_LOST +#define GL_CONTEXT_LOST 0x0507 +#endif + QOpenGLExtensionMatcher::QOpenGLExtensionMatcher() { QOpenGLContext *ctx = QOpenGLContext::currentContext(); @@ -82,8 +86,13 @@ QOpenGLExtensionMatcher::QOpenGLExtensionMatcher() } else { #ifdef QT_OPENGL_3 // clear error state - while (funcs->glGetError()) {} - + while (true) { // Clear error state. + GLenum error = funcs->glGetError(); + if (error == GL_NO_ERROR) + break; + if (error == GL_CONTEXT_LOST) + return; + }; qt_glGetStringi glGetStringi = (qt_glGetStringi)ctx->getProcAddress("glGetStringi"); if (!glGetStringi) diff --git a/src/gui/opengl/qopenglfunctions_4_4_compatibility.cpp b/src/gui/opengl/qopenglfunctions_4_4_compatibility.cpp index a33efd0b95..5c7170b8fa 100644 --- a/src/gui/opengl/qopenglfunctions_4_4_compatibility.cpp +++ b/src/gui/opengl/qopenglfunctions_4_4_compatibility.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtWidgets module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/opengl/qopenglfunctions_4_4_core.cpp b/src/gui/opengl/qopenglfunctions_4_4_core.cpp index 019a70087a..54833f9058 100644 --- a/src/gui/opengl/qopenglfunctions_4_4_core.cpp +++ b/src/gui/opengl/qopenglfunctions_4_4_core.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtWidgets module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/opengl/qopenglfunctions_4_5_compatibility.h b/src/gui/opengl/qopenglfunctions_4_5_compatibility.h index 7a97085a85..a809c1c90b 100644 --- a/src/gui/opengl/qopenglfunctions_4_5_compatibility.h +++ b/src/gui/opengl/qopenglfunctions_4_5_compatibility.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtWidgets module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/opengl/qopenglfunctions_4_5_core.cpp b/src/gui/opengl/qopenglfunctions_4_5_core.cpp index 27c0223cf9..a47ebb9ee9 100644 --- a/src/gui/opengl/qopenglfunctions_4_5_core.cpp +++ b/src/gui/opengl/qopenglfunctions_4_5_core.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtWidgets module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp index cea4b51a5c..5b7956d31e 100644 --- a/src/gui/opengl/qopengltexture.cpp +++ b/src/gui/opengl/qopengltexture.cpp @@ -3914,8 +3914,7 @@ bool QOpenGLTexture::isAutoMipMapGenerationEnabled() const have disabled automatic mipmap generation then you need to call this function or the overload to create the mipmap chain. - \note Mipmap generation is not supported for compressed textures with OpenGL - ES 2.0. + \note Mipmap generation is not supported for compressed textures with OpenGL ES. \sa setAutoMipMapGenerationEnabled(), setMipLevels(), mipLevels() */ @@ -3926,7 +3925,7 @@ void QOpenGLTexture::generateMipMaps() Q_ASSERT(d->textureId); if (isCompressedFormat(d->format)) { if (QOpenGLContext *ctx = QOpenGLContext::currentContext()) - if (ctx->isOpenGLES() && ctx->format().majorVersion() < 3) + if (ctx->isOpenGLES()) return; } d->texFuncs->glGenerateTextureMipmap(d->textureId, d->target, d->bindingTarget); @@ -3951,7 +3950,7 @@ void QOpenGLTexture::generateMipMaps(int baseLevel, bool resetBaseLevel) Q_ASSERT(d->textureId); if (isCompressedFormat(d->format)) { if (QOpenGLContext *ctx = QOpenGLContext::currentContext()) - if (ctx->isOpenGLES() && ctx->format().majorVersion() < 3) + if (ctx->isOpenGLES()) return; } int oldBaseLevel; diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index 318d55c4c3..e5bac84df9 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -541,7 +541,15 @@ static QStringList get_colornames() \section1 The HSL Color Model HSL is similar to HSV, however instead of the Value parameter, HSL - specifies a Lightness parameter. + specifies a Lightness parameter which maps somewhat differently to the + brightness of the color. + + Similarly, the HSL saturation value is not in general the same as the HSV + saturation value for the same color. hslSaturation() provides the color's + HSL saturation value, while saturation() and hsvSaturation() provides the + HSV saturation value. + + The hue value is defined to be the same in HSL and HSV. \section1 The CMYK Color Model @@ -1098,7 +1106,7 @@ void QColor::setHsv(int h, int s, int v, int a) These components can be retrieved individually using the hslHueF(), hslSaturationF(), lightnessF() and alphaF() functions. - \sa setHsl() + \sa getHsl(), setHslF(), {QColor#The HSL Color Model}{The HSL Color Model} */ void QColor::getHslF(qreal *h, qreal *s, qreal *l, qreal *a) const { @@ -1128,7 +1136,7 @@ void QColor::getHslF(qreal *h, qreal *s, qreal *l, qreal *a) const These components can be retrieved individually using the hslHue(), hslSaturation(), lightness() and alpha() functions. - \sa setHsl() + \sa getHslF(), setHsl(), {QColor#The HSL Color Model}{The HSL Color Model} */ void QColor::getHsl(int *h, int *s, int *l, int *a) const { @@ -1619,11 +1627,11 @@ void QColor::setBlueF(qreal blue) } /*! - Returns the hue color component of this color. + Returns the HSV hue color component of this color. The color is implicitly converted to HSV. - \sa hsvHue(), hueF(), getHsv(), {QColor#The HSV Color Model}{The HSV Color Model} + \sa hsvHue(), hslHue(), hueF(), getHsv(), {QColor#The HSV Color Model}{The HSV Color Model} */ int QColor::hue() const Q_DECL_NOTHROW @@ -1632,9 +1640,9 @@ int QColor::hue() const Q_DECL_NOTHROW } /*! - Returns the hue color component of this color. + Returns the HSV hue color component of this color. - \sa hueF(), getHsv(), {QColor#The HSV Color Model}{The HSV Color Model} + \sa hueF(), hslHue(), getHsv(), {QColor#The HSV Color Model}{The HSV Color Model} */ int QColor::hsvHue() const Q_DECL_NOTHROW { @@ -1644,11 +1652,11 @@ int QColor::hsvHue() const Q_DECL_NOTHROW } /*! - Returns the saturation color component of this color. + Returns the HSV saturation color component of this color. The color is implicitly converted to HSV. - \sa hsvSaturation(), saturationF(), getHsv(), {QColor#The HSV Color Model}{The HSV Color + \sa hsvSaturation(), hslSaturation(), saturationF(), getHsv(), {QColor#The HSV Color Model}{The HSV Color Model} */ @@ -1658,9 +1666,9 @@ int QColor::saturation() const Q_DECL_NOTHROW } /*! - Returns the saturation color component of this color. + Returns the HSV saturation color component of this color. - \sa saturationF(), getHsv(), {QColor#The HSV Color Model}{The HSV Color Model} + \sa saturationF(), hslSaturation(), getHsv(), {QColor#The HSV Color Model}{The HSV Color Model} */ int QColor::hsvSaturation() const Q_DECL_NOTHROW { @@ -1682,11 +1690,11 @@ int QColor::value() const Q_DECL_NOTHROW } /*! - Returns the hue color component of this color. + Returns the HSV hue color component of this color. The color is implicitly converted to HSV. - \sa hsvHueF(), hue(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color Model} + \sa hsvHueF(), hslHueF(), hue(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color Model} */ qreal QColor::hueF() const Q_DECL_NOTHROW { @@ -1696,7 +1704,7 @@ qreal QColor::hueF() const Q_DECL_NOTHROW /*! Returns the hue color component of this color. - \sa hue(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color + \sa hue(), hslHueF(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color Model} */ qreal QColor::hsvHueF() const Q_DECL_NOTHROW @@ -1707,11 +1715,11 @@ qreal QColor::hsvHueF() const Q_DECL_NOTHROW } /*! - Returns the saturation color component of this color. + Returns the HSV saturation color component of this color. The color is implicitly converted to HSV. - \sa hsvSaturationF(), saturation(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color + \sa hsvSaturationF(), hslSaturationF(), saturation(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color Model} */ qreal QColor::saturationF() const Q_DECL_NOTHROW @@ -1720,9 +1728,9 @@ qreal QColor::saturationF() const Q_DECL_NOTHROW } /*! - Returns the saturation color component of this color. + Returns the HSV saturation color component of this color. - \sa saturation(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color Model} + \sa saturation(), hslSaturationF(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color Model} */ qreal QColor::hsvSaturationF() const Q_DECL_NOTHROW { @@ -1746,9 +1754,9 @@ qreal QColor::valueF() const Q_DECL_NOTHROW /*! \since 4.6 - Returns the hue color component of this color. + Returns the HSL hue color component of this color. - \sa getHslF(), getHsl() + \sa hslHueF(), hsvHue(), getHsl(), {QColor#The HSL Color Model}{The HSL Color Model} */ int QColor::hslHue() const Q_DECL_NOTHROW { @@ -1760,9 +1768,9 @@ int QColor::hslHue() const Q_DECL_NOTHROW /*! \since 4.6 - Returns the saturation color component of this color. + Returns the HSL saturation color component of this color. - \sa saturationF(), getHsv(), {QColor#The HSV Color Model}{The HSV Color Model} + \sa hslSaturationF(), hsvSaturation(), getHsl(), {QColor#The HSL Color Model}{The HSL Color Model} */ int QColor::hslSaturation() const Q_DECL_NOTHROW { @@ -1788,9 +1796,9 @@ int QColor::lightness() const Q_DECL_NOTHROW /*! \since 4.6 - Returns the hue color component of this color. + Returns the HSL hue color component of this color. - \sa hue(), getHslF() + \sa hslHue(), hsvHueF(), getHslF() */ qreal QColor::hslHueF() const Q_DECL_NOTHROW { @@ -1802,9 +1810,9 @@ qreal QColor::hslHueF() const Q_DECL_NOTHROW /*! \since 4.6 - Returns the saturation color component of this color. + Returns the HSL saturation color component of this color. - \sa saturationF(), getHslF() + \sa hslSaturation(), hsvSaturationF(), getHslF(), {QColor#The HSL Color Model}{The HSL Color Model} */ qreal QColor::hslSaturationF() const Q_DECL_NOTHROW { @@ -2124,7 +2132,7 @@ QColor QColor::toHsv() const Q_DECL_NOTHROW /*! Creates and returns an HSL QColor based on this color. - \sa fromHsl(), convertTo(), isValid() + \sa fromHsl(), convertTo(), isValid(), {QColor#The HSL Color Model}{The HSL Color Model} */ QColor QColor::toHsl() const Q_DECL_NOTHROW { @@ -2193,27 +2201,32 @@ QColor QColor::toCmyk() const Q_DECL_NOTHROW color.cspec = Cmyk; color.ct.acmyk.alpha = ct.argb.alpha; - // rgb -> cmy - const qreal r = ct.argb.red / qreal(USHRT_MAX); - const qreal g = ct.argb.green / qreal(USHRT_MAX); - const qreal b = ct.argb.blue / qreal(USHRT_MAX); - qreal c = qreal(1.0) - r; - qreal m = qreal(1.0) - g; - qreal y = qreal(1.0) - b; - - // cmy -> cmyk - const qreal k = qMin(c, qMin(m, y)); - - if (!qFuzzyIsNull(k - 1)) { + if (!ct.argb.red && !ct.argb.green && !ct.argb.blue) { + // Avoid div-by-0 below + color.ct.acmyk.cyan = 0; + color.ct.acmyk.magenta = 0; + color.ct.acmyk.yellow = 0; + color.ct.acmyk.black = USHRT_MAX; + } else { + // rgb -> cmy + const qreal r = ct.argb.red / qreal(USHRT_MAX); + const qreal g = ct.argb.green / qreal(USHRT_MAX); + const qreal b = ct.argb.blue / qreal(USHRT_MAX); + qreal c = qreal(1.0) - r; + qreal m = qreal(1.0) - g; + qreal y = qreal(1.0) - b; + + // cmy -> cmyk + const qreal k = qMin(c, qMin(m, y)); c = (c - k) / (qreal(1.0) - k); m = (m - k) / (qreal(1.0) - k); y = (y - k) / (qreal(1.0) - k); - } - color.ct.acmyk.cyan = qRound(c * USHRT_MAX); - color.ct.acmyk.magenta = qRound(m * USHRT_MAX); - color.ct.acmyk.yellow = qRound(y * USHRT_MAX); - color.ct.acmyk.black = qRound(k * USHRT_MAX); + color.ct.acmyk.cyan = qRound(c * USHRT_MAX); + color.ct.acmyk.magenta = qRound(m * USHRT_MAX); + color.ct.acmyk.yellow = qRound(y * USHRT_MAX); + color.ct.acmyk.black = qRound(k * USHRT_MAX); + } return color; } @@ -2431,7 +2444,7 @@ QColor QColor::fromHsvF(qreal h, qreal s, qreal v, qreal a) The value of \a s, \a l, and \a a must all be in the range 0-255; the value of \a h must be in the range 0-359. - \sa toHsl(), fromHslF(), isValid() + \sa toHsl(), fromHslF(), isValid(), {QColor#The HSL Color Model}{The HSL Color Model} */ QColor QColor::fromHsl(int h, int s, int l, int a) { @@ -2463,7 +2476,7 @@ QColor QColor::fromHsl(int h, int s, int l, int a) All the values must be in the range 0.0-1.0. - \sa toHsl(), fromHsl(), isValid() + \sa toHsl(), fromHsl(), isValid(), {QColor#The HSL Color Model}{The HSL Color Model} */ QColor QColor::fromHslF(qreal h, qreal s, qreal l, qreal a) { diff --git a/src/gui/painting/qdrawhelper_sse4.cpp b/src/gui/painting/qdrawhelper_sse4.cpp index e3cc1dd43e..f6c2f11eaf 100644 --- a/src/gui/painting/qdrawhelper_sse4.cpp +++ b/src/gui/painting/qdrawhelper_sse4.cpp @@ -174,7 +174,7 @@ template<bool RGBA> static inline void convertARGBFromRGBA64PM_sse4(uint *buffer, const QRgba64 *src, int count) { int i = 0; - const __m128i alphaMask = _mm_set1_epi64x(Q_UINT64_C(0xffff) << 48); + const __m128i alphaMask = _mm_set1_epi64x(qint64(Q_UINT64_C(0xffff) << 48)); const __m128i alphaMask32 = _mm_set1_epi32(0xff000000); const __m128i rgbaMask = _mm_setr_epi8(2, 1, 0, 3, 6, 5, 4, 7, 10, 9, 8, 11, 14, 13, 12, 15); const __m128i zero = _mm_setzero_si128(); diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp index 1aee7d5f74..bfe1c9cadf 100644 --- a/src/gui/painting/qpaintengine.cpp +++ b/src/gui/painting/qpaintengine.cpp @@ -913,7 +913,7 @@ void QPaintEngine::setPaintDevice(QPaintDevice *device) /*! Returns the device that this engine is painting on, if painting is - active; otherwise returns 0. + active; otherwise returns \nullptr. */ QPaintDevice *QPaintEngine::paintDevice() const { diff --git a/src/gui/painting/qpathsimplifier.cpp b/src/gui/painting/qpathsimplifier.cpp index 40585ec502..4251840bbc 100644 --- a/src/gui/painting/qpathsimplifier.cpp +++ b/src/gui/painting/qpathsimplifier.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/painting/qpathsimplifier_p.h b/src/gui/painting/qpathsimplifier_p.h index 6ef298f6bf..6c0062c592 100644 --- a/src/gui/painting/qpathsimplifier_p.h +++ b/src/gui/painting/qpathsimplifier_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp index 3081a4b1b6..afb4613ba5 100644 --- a/src/gui/painting/qplatformbackingstore.cpp +++ b/src/gui/painting/qplatformbackingstore.cpp @@ -411,6 +411,7 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion ®i } else if (!region.isEmpty()){ funcs->glBindTexture(GL_TEXTURE_2D, d_ptr->textureId); QPlatformGraphicsBufferHelper::lockAndBindToTexture(graphicsBuffer, &d_ptr->needsSwizzle, &d_ptr->premultiplied); + graphicsBuffer->unlock(); } if (graphicsBuffer->origin() == QPlatformGraphicsBuffer::OriginBottomLeft) diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp index 4776545be6..292952b7c0 100644 --- a/src/gui/painting/qstroker.cpp +++ b/src/gui/painting/qstroker.cpp @@ -455,12 +455,12 @@ void QStroker::joinPoints(qfixed focal_x, qfixed focal_y, const QLineF &nextLine return; } #endif + QLineF prevLine(qt_fixed_to_real(m_back2X), qt_fixed_to_real(m_back2Y), + qt_fixed_to_real(m_back1X), qt_fixed_to_real(m_back1Y)); + QPointF isect; + QLineF::IntersectType type = prevLine.intersect(nextLine, &isect); if (join == FlatJoin) { - QLineF prevLine(qt_fixed_to_real(m_back2X), qt_fixed_to_real(m_back2Y), - qt_fixed_to_real(m_back1X), qt_fixed_to_real(m_back1Y)); - QPointF isect; - QLineF::IntersectType type = prevLine.intersect(nextLine, &isect); QLineF shortCut(prevLine.p2(), nextLine.p1()); qreal angle = shortCut.angleTo(prevLine); if (type == QLineF::BoundedIntersection || (angle > 90 && !qFuzzyCompare(angle, (qreal)90))) { @@ -472,12 +472,6 @@ void QStroker::joinPoints(qfixed focal_x, qfixed focal_y, const QLineF &nextLine qt_real_to_fixed(nextLine.y1())); } else { - QLineF prevLine(qt_fixed_to_real(m_back2X), qt_fixed_to_real(m_back2Y), - qt_fixed_to_real(m_back1X), qt_fixed_to_real(m_back1Y)); - - QPointF isect; - QLineF::IntersectType type = prevLine.intersect(nextLine, &isect); - if (join == MiterJoin) { qreal appliedMiterLimit = qt_fixed_to_real(m_strokeWidth * m_miterLimit); @@ -512,7 +506,11 @@ void QStroker::joinPoints(qfixed focal_x, qfixed focal_y, const QLineF &nextLine qfixed offset = m_strokeWidth / 2; QLineF l1(prevLine); - l1.translate(l1.dx(), l1.dy()); + qreal dp = QPointF::dotProduct(QPointF(prevLine.dx(), prevLine.dy()), QPointF(nextLine.dx(), nextLine.dy())); + if (dp > 0) // same direction, means that prevLine is from a bezier that has been "reversed" by shifting + l1 = QLineF(prevLine.p2(), prevLine.p1()); + else + l1.translate(l1.dx(), l1.dy()); l1.setLength(qt_fixed_to_real(offset)); QLineF l2(nextLine.p2(), nextLine.p1()); l2.translate(l2.dx(), l2.dy()); @@ -570,7 +568,11 @@ void QStroker::joinPoints(qfixed focal_x, qfixed focal_y, const QLineF &nextLine // first control line QLineF l1 = prevLine; - l1.translate(l1.dx(), l1.dy()); + qreal dp = QPointF::dotProduct(QPointF(prevLine.dx(), prevLine.dy()), QPointF(nextLine.dx(), nextLine.dy())); + if (dp > 0) // same direction, means that prevLine is from a bezier that has been "reversed" by shifting + l1 = QLineF(prevLine.p2(), prevLine.p1()); + else + l1.translate(l1.dx(), l1.dy()); l1.setLength(QT_PATH_KAPPA * offset); // second control line, find through normal between prevLine and focal. @@ -705,7 +707,6 @@ template <class Iterator> bool qt_stroke_side(Iterator *it, QPointF(qt_fixed_to_real(e.x), qt_fixed_to_real(e.y)), QPointF(qt_fixed_to_real(cp2.x), qt_fixed_to_real(cp2.y)), QPointF(qt_fixed_to_real(ep.x), qt_fixed_to_real(ep.y))); - int count = bezier.shifted(offsetCurves, MAX_OFFSET, offset, diff --git a/src/gui/text/qdistancefield.cpp b/src/gui/text/qdistancefield.cpp index e7ca00b3a9..82bb617733 100644 --- a/src/gui/text/qdistancefield.cpp +++ b/src/gui/text/qdistancefield.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/text/qdistancefield_p.h b/src/gui/text/qdistancefield_p.h index 27ab84332c..31cdf7edd2 100644 --- a/src/gui/text/qdistancefield_p.h +++ b/src/gui/text/qdistancefield_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp index 0026e3edfb..dd894f4d32 100644 --- a/src/gui/text/qstatictext.cpp +++ b/src/gui/text/qstatictext.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the test suite of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/text/qstatictext.h b/src/gui/text/qstatictext.h index e6a196d865..ada0456b8f 100644 --- a/src/gui/text/qstatictext.h +++ b/src/gui/text/qstatictext.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the test suite of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/text/qstatictext_p.h b/src/gui/text/qstatictext_p.h index c4023488ff..4ec09297c5 100644 --- a/src/gui/text/qstatictext_p.h +++ b/src/gui/text/qstatictext_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the test suite of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/text/qsyntaxhighlighter.cpp b/src/gui/text/qsyntaxhighlighter.cpp index b09f8b565a..0e07b69868 100644 --- a/src/gui/text/qsyntaxhighlighter.cpp +++ b/src/gui/text/qsyntaxhighlighter.cpp @@ -376,6 +376,7 @@ void QSyntaxHighlighter::rehighlight() QTextCursor cursor(d->doc); d->rehighlight(cursor, QTextCursor::End); + d->rehighlightPending = false; // user manually did a full rehighlight } /*! diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp index af8fcf369c..7719a2e6da 100644 --- a/src/gui/text/qtextcursor.cpp +++ b/src/gui/text/qtextcursor.cpp @@ -2116,7 +2116,7 @@ QTextList *QTextCursor::createList(QTextListFormat::Style style) /*! Returns the current list if the cursor position() is inside a - block that is part of a list; otherwise returns 0. + block that is part of a list; otherwise returns \nullptr. \sa insertList(), createList() */ @@ -2176,7 +2176,7 @@ QTextTable *QTextCursor::insertTable(int rows, int cols, const QTextTableFormat /*! Returns a pointer to the current table if the cursor position() - is inside a block that is part of a table; otherwise returns 0. + is inside a block that is part of a table; otherwise returns \nullptr. \sa insertTable() */ @@ -2213,7 +2213,7 @@ QTextFrame *QTextCursor::insertFrame(const QTextFrameFormat &format) } /*! - Returns a pointer to the current frame. Returns 0 if the cursor is invalid. + Returns a pointer to the current frame. Returns \nullptr if the cursor is invalid. \sa insertFrame() */ diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 506df0664d..9ed497839c 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1398,11 +1398,12 @@ void QTextEngine::shapeText(int item) const #ifndef QT_NO_RAWFONT if (useRawFont) { QTextCharFormat f = format(&si); - kerningEnabled = f.fontKerning(); + QFont font = f.font(); + kerningEnabled = font.kerning(); shapingEnabled = QFontEngine::scriptRequiresOpenType(QChar::Script(si.analysis.script)) - || (f.fontStyleStrategy() & QFont::PreferNoShaping) == 0; - wordSpacing = QFixed::fromReal(f.fontWordSpacing()); - letterSpacing = QFixed::fromReal(f.fontLetterSpacing()); + || (font.styleStrategy() & QFont::PreferNoShaping) == 0; + wordSpacing = QFixed::fromReal(font.wordSpacing()); + letterSpacing = QFixed::fromReal(font.letterSpacing()); letterSpacingIsAbsolute = true; } else #endif diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp index e2130a09d9..0ed8be8530 100644 --- a/src/gui/text/qtextobject.cpp +++ b/src/gui/text/qtextobject.cpp @@ -1301,7 +1301,7 @@ const QTextDocument *QTextBlock::document() const /*! If the block represents a list item, returns the list that the item belongs - to; otherwise returns 0. + to; otherwise returns \nullptr. */ QTextList *QTextBlock::textList() const { diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp index b6eac91478..8c7cf8682c 100644 --- a/src/gui/util/qdesktopservices.cpp +++ b/src/gui/util/qdesktopservices.cpp @@ -244,6 +244,8 @@ bool QDesktopServices::openUrl(const QUrl &url) The provided method must be implemented as a slot that only accepts a single QUrl argument. + \snippet code/src_gui_util_qdesktopservices.cpp 0 + To use this function for receiving data from other apps on iOS you also need to add the custom scheme to the \c CFBundleURLSchemes list in your Info.plist file: diff --git a/src/gui/util/qlayoutpolicy.cpp b/src/gui/util/qlayoutpolicy.cpp index b2b18c0c8b..507df44a45 100644 --- a/src/gui/util/qlayoutpolicy.cpp +++ b/src/gui/util/qlayoutpolicy.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Qt Quick Layouts module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/util/qlayoutpolicy_p.h b/src/gui/util/qlayoutpolicy_p.h index a729a57e8b..d92896e6e3 100644 --- a/src/gui/util/qlayoutpolicy_p.h +++ b/src/gui/util/qlayoutpolicy_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Qt Quick Layouts module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/util/qshaderlanguage.cpp b/src/gui/util/qshaderlanguage.cpp index f9192f5ff3..efd607ba60 100644 --- a/src/gui/util/qshaderlanguage.cpp +++ b/src/gui/util/qshaderlanguage.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Qt Quick Layouts module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/util/qshaderlanguage_p.h b/src/gui/util/qshaderlanguage_p.h index e392a6c7bb..3af967b8c6 100644 --- a/src/gui/util/qshaderlanguage_p.h +++ b/src/gui/util/qshaderlanguage_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Qt Quick Layouts module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/util/qshadernode.cpp b/src/gui/util/qshadernode.cpp index 676667ddcf..e570880d1d 100644 --- a/src/gui/util/qshadernode.cpp +++ b/src/gui/util/qshadernode.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Qt Quick Layouts module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/util/qshadernode_p.h b/src/gui/util/qshadernode_p.h index 494c87bc18..12ff9b2a2c 100644 --- a/src/gui/util/qshadernode_p.h +++ b/src/gui/util/qshadernode_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Qt Quick Layouts module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/util/qtexturefilehandler_p.h b/src/gui/util/qtexturefilehandler_p.h index b808d3e7db..3d4f42526f 100644 --- a/src/gui/util/qtexturefilehandler_p.h +++ b/src/gui/util/qtexturefilehandler_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtQuick module of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage |