QObjectListModel-QQuickList icon indicating copy to clipboard operation
QObjectListModel-QQuickList copied to clipboard

Crash bug in qobjectlistmodel.cpp - QObjectListModel::timerEvent

Open antarespilot opened this issue 10 years ago • 1 comments

Hi,

I've had some crashes in qobjectlistmodel.cpp. The timerEvent function is sometimes called even with m_notifyIndexes being empty. I don't know why, but it does happen in real-world applications.

Changing the function into something like this seems to fix it, at least for me. I'm just checking that m_notifyIndexes is not empty before emitting dataChanged:

void QObjectListModel::timerEvent(QTimerEvent * ev) { if (ev->timerId() != m_notifyTimer.timerId()) return; if (!m_notifyIndexes.isEmpty()) emit dataChanged(index(m_notifyIndexes.begin().key()), index((m_notifyIndexes.end()-1).key()), QVector(1, Qt::DisplayRole)); m_notifyTimer.stop(); m_notifyIndexes.clear(); }

antarespilot avatar Feb 09 '15 08:02 antarespilot

Thanks for the feedback. I will look into it soon.

Murazaki avatar Feb 09 '15 08:02 Murazaki