But also why are you using raw pointers?
Qt has Smart Pointers . That's assuming the Standard ones aren't sufficient, which they ought to be. Smart Pointers abstract the hard parts of memory management and help keep you leak free.
That said. Do you need pointers at all? Now I return to my disclaimer. I did read the documentation on Signal/Slots in Qt only briefly but I believe you can generate all of your Objects as pointer-free RAII class instances.
You declare a (needed) destructor for cleanup of all your pointers. If you declare a destructor you need a Copy Constructor, a Copy Assignment Operator, a Move Constructor and a Move Assignment Operator as well. However if you eliminate your pointers you can remove your destructor and rely on the rule of 0 (Don't declare any of them let the compiler do it.)
But also why are you using raw pointers?
Qt has Smart Pointers . That's assuming the Standard ones aren't sufficient, which they ought to be. Smart Pointers abstract the hard parts of memory management and help keep you leak free.
That said. Do you need pointers at all? Now I return to my disclaimer. I did read the documentation on Signal/Slots in Qt only briefly but I believe you can generate all of your Objects as pointer-free RAII class instances.
You declare a (needed) destructor for cleanup of all your pointers. If you declare a destructor you need a Copy Constructor, a Copy Assignment Operator, a Move Constructor and a Move Assignment Operator as well. However if you eliminate your pointers you can remove your destructor and rely on the rule of 0 (Don't declare any of them let the compiler do it.)
You declare a (needed) destructor for cleanup of all your pointers. If you declare a destructor you need a Copy Constructor, a Copy Assignment Operator, a Move Constructor and a Move Assignment Operator as well.