This is my first post on here. I have ran into an interesting issue that I haven't been able to figure out for a couple of weeks. After trying many different things and reading lots of posts, I am now hoping somebody on here has an idea.
I have a crash that only occurs on the deployed version of the software on computers that do not have Qt installed. I have used the Depends program for figuring out which DLLs I needed and recently tried using windeployqt as an alternative. My program is able to launch fine and run normally. However, there is a particular sequence of events I do that causes a crash only on the deployed version.
I have used a program called DebugView and was able to trace the exact line that the program crashes. It crashes on a BeginRemoveRows statement. The code looks like the following in this function:
bool AMPModel
::removeItems(int position,
int rows,
const QModelIndex &parent
) {
AMPModelItem *parentItem = getItem(parent);
bool success = true;
beginRemoveRows(parent, position, position + rows - 1);
success = parentItem->removeChildren(position, rows);
endRemoveRows();
return success;
}
bool AMPModel::removeItems(int position, int rows, const QModelIndex &parent)
{
AMPModelItem *parentItem = getItem(parent);
bool success = true;
beginRemoveRows(parent, position, position + rows - 1);
success = parentItem->removeChildren(position, rows);
endRemoveRows();
return success;
}
To copy to clipboard, switch view to plain text mode
I have outputted the variables, the moment before the crash and get the following:
position = 5
rows = 1
I also outputted the number of children of the parentItem which is 6. The QModelIndex exists, and so does the parentItem after the getItem function.
I get the same variable output while running in debug mode on my development computer. However, it does not crash nor does running the same compiled version on that computer crash.
The overall picture of what I'm doing is that I have a model that contains my data and I'm switching between two ways of viewing this model (a tree view and a graphical view that I created). It seems to crash when I click within the tree view (just select any item), switch to the graphical view, and try to delete an item. If I do not select an item within my tree view, then I do not get the crash.
If anybody has any suggestions on what to try, I would really appreciate it. If you need more clarification, I would be happy to provide it.
Thanks!
Bookmarks