Can a signal have a QJsonDocument argument?
-
@
class QReply : public QObject {
Q_OBJECT
signals:
void finished(QJsonDocument* json);
void finished(QJsonDocument json);
};
@I wonder what type the json arg should be? A pointer? If so, who deletes it and when? Since QJsonDocument is not a QObject I cannot deleteLater() it. So I guess I could use a QJsonDocument as argument and copy ctor will take care of transfering the internal state of the Json object to the slots?
-
both are applicable.
Where do you create the document object?
Since your QReply class emits the signal it may manage the pointer and delete it in it's constructor.
It depends on your application logic if only the value for the receiver counts of if you need the pointer to modify this specific object.