Hello all,
is it a good idea to create all data objects derived from QObject? Microsoft's MFC Class CObject is built this way but I wanted to see if there is a reason NOT to do this in QT.
Cheers!
-Caolan O'Domhnaill
Printable View
Hello all,
is it a good idea to create all data objects derived from QObject? Microsoft's MFC Class CObject is built this way but I wanted to see if there is a reason NOT to do this in QT.
Cheers!
-Caolan O'Domhnaill
If you mean value classes, then no.
You derive from QObject when you need things like properties, signals, slots, components that need to be treated in an abstracted way or communicate with another.
Or maybe more generically: in C++ you derive from a class if you need to do that, if your new class needs to be treatable as the base class.
Cheers,
_