I'm back with another very confusing problem.
I have 2 versions of the same program. Call them A & B. I use
void MyDrawingFrame
::slotSetPaintItems ( QStringList list
) {
int n;
for(n = 0; n < list.count(); ++n )
{
tempList = list[n].split("|"); /// split the list into types of stringLists
k = tempList[0]; /// get the type of element to draw
if(k == "erase") clearWindow = "erase";
else
{
tempList.removeFirst(); /// remove the element with the code
clearWindow = "false";
if(k=="supports")
paintSupportLines=tempList;
else if(k=="columns")
paintColumns=tempList;
else if(k=="help")
paintDrawHelpWindow=tempList;
else if(k=="erase")
clearWindow="true";
}
}
emit getDrawingFrameSize (&W,&H);
k = actionList.last();
tempList = k.split(",");
if(tempList[1] == "4") setGeometry (10,10,W ,H);
else setGeometry (10,10,0,0);
update();
}
void MyDrawingFrame::slotSetPaintItems ( QStringList list )
{
int n;
for(n = 0; n < list.count(); ++n )
{
tempList = list[n].split("|"); /// split the list into types of stringLists
k = tempList[0]; /// get the type of element to draw
if(k == "erase") clearWindow = "erase";
else
{
tempList.removeFirst(); /// remove the element with the code
clearWindow = "false";
if(k=="supports")
paintSupportLines=tempList;
else if(k=="columns")
paintColumns=tempList;
else if(k=="help")
paintDrawHelpWindow=tempList;
else if(k=="erase")
clearWindow="true";
}
}
emit getDrawingFrameSize (&W,&H);
k = actionList.last();
tempList = k.split(",");
if(tempList[1] == "4") setGeometry (10,10,W ,H);
else setGeometry (10,10,0,0);
update();
}
To copy to clipboard, switch view to plain text mode
for both versions and as near as I can tell the same data. There are two stages. The first just displays the "support lines" and the second displays both the "support lines" and the "colums".(see attachments from version B) Version A is fine for just the support lines, but when trying to display both the program crashes with the following statement which I don't understand at all.
{ Q_ASSERT_X(i >= 0 && i < p.size(), "QList<T>:

perator[]", "index out of range");
detach(); return reinterpret_cast<Node *>(p.at(i))->t(); }
I have replaced the "update" with "redraw" but same problem. I don't think the problem is in the "paint event" itself,
As usual I would appreciate any help you can give me.
thanks.
Bookmarks