29.05.2019, 15:49, "drwho" <[email protected]>:
> 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?
You should use std::enable_shared_from_this instead.
>
> 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
>
> _______________________________________________
> Development mailing list
> [email protected]
> https://lists.qt-project.org/listinfo/development
--
Regards,
Konstantin
_______________________________________________
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development