[Development] Qt 5 types under consideration for deprecation / removal in Qt 6

drwho drwho at infidigm.net
Wed May 29 14:39:53 CEST 2019


On 2019-05-29 6:53 a.m., Mutz, Marc via Development wrote:
>
> == QSharedPointer / QWeakPointer -> std::shared_ptr/weak_ptr ==
>
> Once they are stripped of their magic QObject handling and QObject 
> handling returned to QPointer proper, they don't do much other than 
> std::shared_ptr, except being less flexible and largely untested for 
> exception-safety.

so QEnableSharedFromThis::sharedFromThis() would return a std::shared_ptr?

class Device : public QObject, public QEnableSharedFromThis<Device>
{
     Q_OBJECT
public:
     Device();

signals:
     void update(QSharedPointer<Device> device);

};

in some method in Device....

emit update(sharedFromThis());

Jon



More information about the Development mailing list