void AccountWindow::displayEvent(const QDate &curDate)
{
QFile file(filename);
file.open(QIODevice::ReadOnly);
QDataStream in(&file);
while(!in.atEnd())
{
Event *p = new Event;
in.readRawData((char *)p, sizeof(Event));
if (p->getStartDate() == curDate)
{
QString strEvent;
strEvent = p->getStartDate().toString("MM.dd")
+ p->getStartTime().toString("h:m") + " - "
+ p->getEndDate().toString("MM.dd")
+ p->getEndTime().toString("h:m") + " "
+ p->getTitle() + '\n'; //此处调用函数
ui->textBrowser->append(strEvent);
}
}
//Event.cpp
QString Event::getTitle()
{
return title; //此处有错误
}
底层停止了因为它触发了一个异常。
在线程0中停止,因为: Exception at 0x744dc25a, code: 0xc0000005: read access violation at: 0x0, flags=0x0。