I understand why I get a C2248: \'QObject::QObject\' : cannot access private member declared in class \'QObject\'
. Qt objects are not copyable, as explained here:<
If you are not explicitly copying your MyObject
but you keep getting this error message then something you're using in conjunction with your MyObject
is doing the copying on your behalf.
The most likely culprit would be one of the container classes, e.g. QList
, QVector
, etc.
Read the Container class documentation for more information as well as the specific class' documentation of any container you might be using. All containers have requirements of their elements, e.g. Must have default constructor, must be assignable, etc. This is where I think your problem lies.