qt5base-lts/tests/auto/corelib/kernel/qobject
Giuseppe D'Angelo c613dd4765 QMetaType: disable conversion from smart pointer<const QObject>
QMetaType can register a converter from a smart pointer class to
QObject *. The code tries to do so even if the smart pointer is
actually holding a pointer to a _const_ QObject
(e.g. shared_ptr<const QObject>), causing a compile error:

  ../src/qt5/qtbase/build/include/QtCore/../../../src/corelib/kernel/qmetatype.h:1208:32: error: invalid conversion from ‘const QObject*’ to ‘QObject*’ [-fpermissive]
   1208 |             return p.operator->();
        |                    ~~~~~~~~~~~~^~
        |                                |
        |                                const QObject*

Disable the conversion if indeed the source is const qualified.

Change-Id: I9e9bc5992f74131e5cfd6ece9b83d4f26d370e92
Fixes: QTBUG-103741
Pick-to: 6.2 6.3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-21 11:43:59 +02:00
..
signalbug Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
.gitignore tst_qobject: Fix execution in debug&release shadow builds 2018-06-26 10:56:31 +00:00
CMakeLists.txt QObject: port to new property system 2021-04-21 15:34:28 +02:00
tst_qobject.cpp QMetaType: disable conversion from smart pointer<const QObject> 2022-05-21 11:43:59 +02:00