QMetaContainer: Allow retrieving the d pointer
This is in line with how QMetaType handles QMetaTypeInterface*. You can retrieve a const pointer to it. Pick-to: 6.6 Task-number: QTBUG-113690 Change-Id: Iaf3c10603dc6049a5553987c90006807867abc0d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>bb10
parent
46d69b6ca4
commit
937751f427
|
|
@ -982,6 +982,8 @@ public:
|
|||
return a.d() != b.d();
|
||||
}
|
||||
|
||||
const QtMetaContainerPrivate::QMetaSequenceInterface *iface() const { return d(); }
|
||||
|
||||
private:
|
||||
template<typename T>
|
||||
struct MetaSequence
|
||||
|
|
@ -1176,6 +1178,8 @@ public:
|
|||
return a.d() != b.d();
|
||||
}
|
||||
|
||||
const QtMetaContainerPrivate::QMetaAssociationInterface *iface() const { return d(); }
|
||||
|
||||
private:
|
||||
template<typename T>
|
||||
struct MetaAssociation
|
||||
|
|
|
|||
|
|
@ -497,6 +497,10 @@ void tst_QMetaContainer::testSequence()
|
|||
QVERIFY(metaSequence.compareConstIterator(constIt, constEnd));
|
||||
metaSequence.destroyConstIterator(constIt);
|
||||
metaSequence.destroyConstIterator(constEnd);
|
||||
|
||||
QVERIFY(metaSequence.iface() != nullptr);
|
||||
QMetaSequence defaultConstructed;
|
||||
QVERIFY(defaultConstructed.iface() == nullptr);
|
||||
}
|
||||
|
||||
void tst_QMetaContainer::testAssociation_data()
|
||||
|
|
@ -722,6 +726,10 @@ void tst_QMetaContainer::testAssociation()
|
|||
QVERIFY(metaAssociation.compareConstIterator(constIt, constEnd));
|
||||
metaAssociation.destroyConstIterator(constIt);
|
||||
metaAssociation.destroyConstIterator(constEnd);
|
||||
|
||||
QVERIFY(metaAssociation.iface() != nullptr);
|
||||
QMetaSequence defaultConstructed;
|
||||
QVERIFY(defaultConstructed.iface() == nullptr);
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QMetaContainer)
|
||||
|
|
|
|||
Loading…
Reference in New Issue