타이머를 사용하여 슬롯 checkBookings()
을 반복적으로 호출합니다. 프로그램을 컴파일하고 실행할 수 있지만 위의 FOR 루프를 실행할 때 충돌이 발생합니다.QList 인덱스가 범위를 벗어났습니다.
Error:"ASSERT failure in QList::at: "index out of range", file ../../../../Qt/2010.05/qt/include/QtCore/../../src/corelib/tools/qlist.h, line 455 Invalid parameter passed to C runtime function. Invalid parameter passed to C runtime function."
내 코드는 다음과 같습니다
timer = new QTimer();
connect(timer,SIGNAL(timeout()),this,SLOT(checkBookings()));
timer->start(500000);
void Canvas::checkBookings()
{
QString dateStr;
for(int i= 0;i<=qlist.count();i++)
{
dateStr = qList.at(i).at(6);
}
}
이가 대답 할 될 수 없습니다. – cgmb