I initialize a pointer from a list of pointers. I can read data from this pointer without a problem(line 2), but when I try to write any data(line 3), it crashes.
When i put a breakpoint on line 3, the debugger shows that the pointer is pointing to the correct object based on its variables.
DimensionItem *DI = DimItems[j];
qDebug() << "DI xposition: " << DI->pos().x();
DI->setPos(1,1);
If I breakpoint on line 3, my application output is:
::Debug::{(../Zedspex/Widgets/automeasurewidget.cpp:434)}:: DI xposition: 5.15645e-312
And I can see data in DI in the debugger:
A pop-up saying a seg fault occurred. This is the only message from the dubugger:
signal 11 (Segmentation fault), address is 0x2c from 0x4340cec4
[bt]: (1) /usr/lib/libQt5Widgets.so.5(_ZN13QGraphicsItem6setPosERK7QPointF+0x8c) [0x4340cec4]