<div dir="ltr">Hey all,<div style>I've found more often than I'd like in my unit tests I'm writing a custom deleter for QObjects when using a QScopedPointer. Something to the effect of:</div><div style><br></div>
<div style><div>struct QObjectDeleter</div><div>{</div><div>    static inline void cleanup(QObject *pointer) {</div><div>        if (pointer)</div><div>            pointer->deleteLater();</div><div>    }</div><div>};</div>
<div><br></div><div style>and then:</div><div style><br></div><div style>QScopedPointer<MyQObjectSubclass, QObjectDeleter> object;</div><div style><br></div><div style>Is there a reason this wasn't added for convenience? Or, would there be interest in me submitting a patch to include this in a later version of Qt? We should even be able to fix this seamlessly with templates unless I'm mistaken. </div>
<div style><br></div><div style>Regards,</div><div style>Matt</div></div></div>