Closed
Description
Currently we assume that it'll be QObject* parent = nullptr
, but for some Qt types (eg QQuickPaintedItem or QQuickItem) the parent is different.
We need to have a way in the cxx_qt::qobject
macro to be able to specify a different parent other than QObject
.
There seems to be these options
- If we can assume all parent types will be a raw pointer then just have
#[cxx_qt::qobject(base = "QQuickPaintedItem", parent = "QQuickItem"]
- If we can't assume this then we might need something like
#[cxx_qt::qobject(base = "QQuickPaintedItem", parent_ptr = "QQuickItem"]
or#[cxx_qt::qobject(base = "QQuickPaintedItem", parent = "QQuickItem*", parent_default = "nullptr"]
- Have a separate macro for items that aren't directly derived from
QObject
, eg have#[cxx_qt::qquickitem(base = "QQuickPaintedItem")]
this then means that we can generate the different asserts and parent etc and it's clear to the developer which base the type is deriving from