diff options
| author | Semih Yavuz <semih.yavuz@qt.io> | 2023-01-06 18:39:43 +0300 |
|---|---|---|
| committer | Semih Yavuz <semih.yavuz@qt.io> | 2023-01-10 15:09:23 +0300 |
| commit | afc7928d1a1e47ecbc9d101c4e5d5fb1c5b78326 (patch) | |
| tree | ea709cb4752ba747b6670b23be2df268e8aa7ae4 /tests/auto/qml/qmlcppcodegen/data/equalityQObjects.qml | |
| parent | 1609f8628d1469f723a762c60ccb5856637956dc (diff) | |
QmlCachegen: Equality comparison ability to QObject *
We should be able to compare QObject * with QObject * or a
nullptr.
Pick-to: 6.5
Fixes: QTBUG-109377
Change-Id: I0e9d6fdc89cbb471774d6382316dfb4813310e1d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data/equalityQObjects.qml')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/data/equalityQObjects.qml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/equalityQObjects.qml b/tests/auto/qml/qmlcppcodegen/data/equalityQObjects.qml new file mode 100644 index 0000000000..ce2da605d7 --- /dev/null +++ b/tests/auto/qml/qmlcppcodegen/data/equalityQObjects.qml @@ -0,0 +1,19 @@ +pragma Strict +import QtQml +import TestTypes + +QtObject { + id: self + + property QtObject nullObject + property QtObject nonNullObject: QtObject {} + property QtObject sameNonNullObject: nonNullObject + property QtObject derivedObject: Person {name: "patron"} + + property bool derivedIsNotNull: derivedObject !== null + property bool nullObjectIsNull: nullObject === null + property bool nonNullObjectIsNotNull: null !== nonNullObject + property bool compareSameObjects: sameNonNullObject === nonNullObject + property bool compareDifferentObjects: derivedObject !== nonNullObject + property bool compareObjectWithNullObject: nullObject !== nonNullObject +} |
