diff options
| author | Thiago Macieira <thiago.macieira@intel.com> | 2025-04-04 08:24:04 -0700 |
|---|---|---|
| committer | Thiago Macieira <thiago.macieira@intel.com> | 2025-04-10 19:26:04 -0700 |
| commit | 7cf49085eb47ae660d05e8579c08a3ad3be75021 (patch) | |
| tree | 0fb05b6f7d8d3f14ae19374f29be26b595cb4bd5 /src/corelib/kernel/qmetaobject.cpp | |
| parent | 9ffbeae50e768c37865ec08e7d8716b9fa75f575 (diff) | |
QMetaType/QVariant: update docs that canConvert() operates on types
Not on values. That is, it indicates whether there is a conversion path
from origin type to the destination type, not that the conversion will
succeed when attempted. For example:
QObject *o = new QAbstractItemModel;
QVariant variant = QVariant::fromValue(o);
qDebug() << variant.canConvert<QAbstractItemModel*>();
This conversion *will* succeed for this particular value of a QObject*,
so canConvert() must return true for conversions between QObject* and
QAbstractItemModel*, despite not all such conversions being possible.
This is also done in preparation of changes being done to the conversion
routines that may cause some FP->integer conversions to fail depending
on the value of the FP.
Fixes: QTBUG-135619
Task-number: QTBUG-135285
Pick-to: 6.8 6.9
Change-Id: I138e34fb61a8b8772c8bfffdf75787a2e007d847
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.cpp')
0 files changed, 0 insertions, 0 deletions
