It's not the data for sure, don't make me elaborate why I'm so sure, just be a believer.
There's something else though, this model is used in multiple combo boxes and the crash happens on a combo box hat is being refilled when another combo box using the same model emits currentIndexChanged(), like this:
void QueryPanel::onArticleChanged(int index)
{
QString articleName
= articleComboBox
->currentText
();
if (articleName.isEmpty() && articleComboBox->count() > 0)
{
articleComboBox->setCurrentIndex(0);
}
else
{
versionComboBoxModel->refresh(articleName);
}
versionComboBox->setCurrentIndex(0);
}
void QueryPanel::onArticleChanged(int index)
{
QString articleName = articleComboBox->currentText();
if (articleName.isEmpty() && articleComboBox->count() > 0)
{
articleComboBox->setCurrentIndex(0);
}
else
{
versionComboBoxModel->refresh(articleName);
}
versionComboBox->setCurrentIndex(0);
}
To copy to clipboard, switch view to plain text mode
So it crashes on
versionComboBoxModel->refresh(articleName);
versionComboBoxModel->refresh(articleName);
To copy to clipboard, switch view to plain text mode
which goes through the initial code up until endResetModel.
The weird thing is that I use beginResetModel and endResetModel in some table models much more complicated and I have no problem there...
PS. If you want to know how I'm so sure about data, it's because
1) I made sure it always get 2 values - "lol" some would say
2) If 1) is not true, then it would crash everywhere on the same input data, unless SQLite or Qt are garbage, which they are not
3) I've seen with my own eyes (literally) that the dude runs the same thing (run on my side, ok, pack, send over, unpack, run, crash) - it's not like I believe what people say
4) I've added debug logs that show the list is fine and it stops right before endResetModel
Bookmarks