Slots: delete(Later) passed in pointers from signal (in general)?
-
Hi,
slots can have a pointer parameter set from the signal
void slotFunction(className* pointerToObjectOfTypeClassName);Should i delete (or deleteLater) that pointer?
I shall for QNetworkAccessManager::finished, see https://doc.qt.io/qt-6/qnetworkaccessmanager.html#finished, but "QWheelEvent" documentation does not state so.
I asked this specifically for QWheelEvent in https://forum.qt.io/topic/140883/qtwheelevent-in-signal-from-handler-should-i-delete-it but perhaps Qt has a general rule about this.
-
Hi,
slots can have a pointer parameter set from the signal
void slotFunction(className* pointerToObjectOfTypeClassName);Should i delete (or deleteLater) that pointer?
I shall for QNetworkAccessManager::finished, see https://doc.qt.io/qt-6/qnetworkaccessmanager.html#finished, but "QWheelEvent" documentation does not state so.
I asked this specifically for QWheelEvent in https://forum.qt.io/topic/140883/qtwheelevent-in-signal-from-handler-should-i-delete-it but perhaps Qt has a general rule about this.
@uani said in Slots: delete(Later) passed in pointers from signal (in general)?:
but "QWheelEvent" documentation does not state so.
You do not have to delete the events! That is done by Qt.