I have made this object class, but i cant use it in the QList, it gives access to private member issue :
using namespace cv;
using namespace std;
class Box:public QObject
void Set_id(int x);
void Set_uitype(string y);
void Set_parent(int x);
void Set_position(string y);
void Set_coordinates(Rect x);
#endif // BOX_H
QList is copying the objects you insert into it, but you can't copy QObjets (any instance of the class derived from QObject) look in documentation "here":http://doc.qt.io/qt-5/qobject.html#Q_DISABLE_COPY
To solve your issue you can create a QList that contains pointers, so must use a QList<Box*>
But i cant even do that if i use c++ vectors, and i have tried to use pointers but it doesnt save the right values of the object' s members
std::vector also stores a copy of your data, so it's the same issue.
If you use pointers and got wrong values it might be that the object get de-allocated before you try to get the values, do you allocate the memory on heap?
No I dint do that, how should I do it?