fix: don't give shared pointer to obj. external to the model

It causes some weird problems and adds refcounting overhead.

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow
2022-08-11 18:24:26 -03:00
parent 97a74d5c1f
commit 92aa24ae34
10 changed files with 58 additions and 54 deletions

View File

@ -3,6 +3,7 @@
#include <QDateTime>
#include <QFileInfo>
#include <QObject>
#include <QPointer>
#include "QObjectPtr.h"
@ -31,6 +32,7 @@ class Resource : public QObject {
Q_DISABLE_COPY(Resource)
public:
using Ptr = shared_qobject_ptr<Resource>;
using WeakPtr = QPointer<Resource>;
Resource(QObject* parent = nullptr);
Resource(QFileInfo file_info);