// Volatile Bool Ptr type definition for QQmlIncubationController::incubateWhile(std::atomic<bool> *, int) #include <atomic> using AtomicBool = std::atomic<bool>; typedef struct { PyObject_HEAD AtomicBool *flag; } QtQml_VolatileBoolObject; #include "pysideqmlregistertype.h" The replace type is needed to use the VolatileBool_Check macro instead of a template conversion function with "volatile bool" as argument. auto volatileBool = reinterpret_cast<QtQml_VolatileBoolObject *>(%PYARG_1); std::atomic<bool> *%out = volatileBool->flag;