QMetaContainer: Allow retrieving the d pointer
This is in line with how QMetaType handles QMetaTypeInterface*. You can
retrieve a const pointer to it.
Task-number: QTBUG-113690
Change-Id: Iaf3c10603dc6049a5553987c90006807867abc0d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 937751f427
)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
f0765c556d
commit
8529d537ac
@ -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
Block a user