woboq/qmetaobject-rs

`qttypes::QPainter` unsound

Opened this issue · 0 comments

QPainter is declared as a cpp_class!, but QPainter can't be moved in memory because the QPainterPrivate holds a q_ptr pointer to the origial QPainter.

cpp_class!(
/// Wrapper around [`QPainter`][class] class.
///
/// [class]: https://doc.qt.io/qt-5/qpainter.html
pub unsafe struct QPainter as "QPainter "
);

We would need to somehow put the QPainter on the heap. But that'd be an incompatible change for people using it via the cpp! macro.