Hello,
I have a little problem wioth my Qt-5 Program by using a QList-Object. If I call QList::isEmpty or ::size, my program stops and I recieve a Segmentation-fault (SIGSEGV), but I cannot explain this error to me. So, I don't see any errors in my code, but I hope you can help me. Heres my code an some Debug-Information:
1 2 3 4 5 6 7 8
|
SGraphNode(QString _sName,
QString _sDescription,
QPoint _ptPosition) : sName(_sName),
sDescription(_sDescription),
ptPosition(_ptPosition)
{
pEdges = new QList<SGraphEdge>();
}
|
1 2 3 4 5 6 7 8 9 10 11
|
if(!m_pGraph->getNodes()->at(i).pEdges->isEmpty())
{
for(int j=0; j<m_pGraph->getNodes()->at(i).pEdges->size();j++)
{
//if(!m_pGraph->getNodes()->at(i).pEdges->at(j).bDrawn)
{
pPainter->drawLine(m_pGraph->getNodes()->at(i).ptPosition,
m_pGraph->getNodes()->at(i).pEdges->at(j).pNeighbour->ptPosition);
}
}
}
|
m_pGraph->getNodes returns a list of SGraphNode-Objects which contain the problematic list.
If I step in the QList-object, I also see that the member "d" in the QList has a very low value (between 0x00 and 0x11)...but I don't know if this helps by solving this problem.
After emitting the SIGSEGV, the debugger jumps into qlist.h, line 93 (
inline bool isEmpty() const { return d->end == d->begin; }
), but there is no more Informatuion given by the Debugger.
I hope you can help me by solving this problem.
Greetings
Niklas