diff options
Diffstat (limited to 'sources/shiboken6/tests/libsample/objecttype.cpp')
-rw-r--r-- | sources/shiboken6/tests/libsample/objecttype.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sources/shiboken6/tests/libsample/objecttype.cpp b/sources/shiboken6/tests/libsample/objecttype.cpp index b58084821..fa3e7357c 100644 --- a/sources/shiboken6/tests/libsample/objecttype.cpp +++ b/sources/shiboken6/tests/libsample/objecttype.cpp @@ -14,6 +14,9 @@ ObjectType::ObjectType(ObjectType *parent) setParent(parent); } +ObjectType::ObjectType(ObjectType &&) noexcept = default; +ObjectType &ObjectType::operator=(ObjectType &&) noexcept = default; + ObjectType::~ObjectType() { for (auto *o : m_children) @@ -29,12 +32,6 @@ ObjectType *ObjectType::createWithChild() return parent; } -const ObjectType *ObjectType::defaultInstance() -{ - static ObjectType result; - return &result; -} - void ObjectType::removeChild(ObjectType *child) { if (!child) @@ -167,10 +164,9 @@ void ObjectType::setLayout(ObjectTypeLayout *l) << "' on ObjectType '" << objectName().cstring() << "', when the ObjectTypeLayout already has a parent layout.\n"; return; - } else { - // Steal the layout from an ObjectType parent. - oldParent->takeLayout(); } + // Steal the layout from an ObjectType parent. + oldParent->takeLayout(); } m_layout = l; @@ -240,7 +236,7 @@ int ObjectType::callId() const void ObjectType::callVirtualCreateChild() { - ObjectType *fake_parent = new ObjectType(); + auto *fake_parent = new ObjectType(); ObjectType *fake_child = createChild(fake_parent); assert(fake_child->isPython()); (void)fake_child; |