diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-07-13 14:53:36 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-07-14 12:07:59 +0200 |
commit | 871a7e2ea74e093d862f954b7ddca374c02cd5b8 (patch) | |
tree | 086a42937d751de3ceb1e3eee9ba8a11edd9cbbb /sources/shiboken2/tests/libsample/objecttypeholder.cpp | |
parent | 805cc07cb18c972eceaea7dc3d48f840f4795243 (diff) |
shiboken2: Handle default parameters of const pointers
Occurs in Qt 6:
QKeyEvent(..., const QInputDevice *device = QInputDevice::primaryKeyboard());
We need a const-cast here since shiboken needs a QInputDevice * for type
conversion.
Change-Id: Iea1137eac44a26b7bc9cf0e1908c0e42ba2de39f
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/tests/libsample/objecttypeholder.cpp')
-rw-r--r-- | sources/shiboken2/tests/libsample/objecttypeholder.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sources/shiboken2/tests/libsample/objecttypeholder.cpp b/sources/shiboken2/tests/libsample/objecttypeholder.cpp index ff2f14f12..be225a0d2 100644 --- a/sources/shiboken2/tests/libsample/objecttypeholder.cpp +++ b/sources/shiboken2/tests/libsample/objecttypeholder.cpp @@ -30,8 +30,14 @@ ObjectTypeHolder::ObjectTypeHolder(const char* objectName) { - m_objectType = new ObjectType(); - m_objectType->setObjectName(objectName); + auto object = new ObjectType(); + object->setObjectName(objectName); + m_objectType = object; +} + +ObjectTypeHolder::ObjectTypeHolder(const ObjectType *object) : + m_objectType(object) +{ } ObjectTypeHolder::~ObjectTypeHolder() |