diff options
Diffstat (limited to 'sources/shiboken6/tests/libsample/objecttypelayout.h')
-rw-r--r-- | sources/shiboken6/tests/libsample/objecttypelayout.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/libsample/objecttypelayout.h b/sources/shiboken6/tests/libsample/objecttypelayout.h new file mode 100644 index 000000000..0aa9fad6e --- /dev/null +++ b/sources/shiboken6/tests/libsample/objecttypelayout.h @@ -0,0 +1,32 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#ifndef OBJECTTYPELAYOUT_H +#define OBJECTTYPELAYOUT_H + +#include "libsamplemacros.h" +#include "objecttype.h" + +#include <list> + +class ObjectType; + +class LIBSAMPLE_API ObjectTypeLayout : public ObjectType +{ +public: + void addObject(ObjectType *obj); + std::list<ObjectType*> objects() const; + + bool isLayoutType() override { return true; } + inline static ObjectTypeLayout *create() { return new ObjectTypeLayout(); } + + ObjectType *takeChild(const Str &name) override { return ObjectType::takeChild(name); } + +private: + std::list<ObjectType*> m_objects; + + void reparentChildren(ObjectType *parent); + friend LIBSAMPLE_API void ObjectType::setLayout(ObjectTypeLayout *l); +}; + +#endif // OBJECTTYPELAYOUT_H |