PDA

View Full Version : ASSERT: "index.isValid()" in file c:\ndk_buildrepos\qt-desktop\src\gui\itemviews\qlis



tesmai4
18th November 2013, 15:30
My QT based GUI application is crashing with following message;

ASSERT: "index.isValid()" in file c:\ndk_buildrepos\qt-desktop\src\gui\itemviews\qlistview.cpp, line 3008

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Press <RETURN> to close this window...

I have tried to remove the problem by looking into the listview that might be generating this exception... but of no use.. Any clue where to look for further?

anda_skoa
18th November 2013, 17:23
Are you using a custom model?

Did you look at the backtrace? What is the last thing before QListView code?

Cheers,
_

tesmai4
18th November 2013, 18:21
Thanks for your reply. Yes, I am using a custom model based on QAbstractListModel.

Sorry, I did not understand your question about, "What is the last thing before QListView code?" [The explanation below help you to understand my scenario]:
The contents of my custom datamodel are changing with mouse movement. At some places; I clear my datamodel and populate with new contents and at some other places, I only clear my datamodel.


A very basic question regarding QT Creator: I don't know how to check where is my program crashing? How can I see the last successfully executed statement in my program using QT Creator? (Visual Studio takes you to the crashing line. Is there something like that in QT Creator?)

Can you give me some clue?

Regards,

anda_skoa
19th November 2013, 09:48
If you run the program in debug mode of Qt Creator it should also show you where it crashed.
The stack trace at that point should have the complete call stack, at the top the assert, then further down the calls that lead there.

Another thing that might help is http://qt-project.org/wiki/Model_Test

Cheers,
_

tesmai4
19th November 2013, 16:49
QT Creator does not show the crash point. I mostly run the program in debug mode. Are there any settings to enable/disable in Qt Creator for showing the crash point or last successful statement before crash.

Regards,

anda_skoa
20th November 2013, 11:20
Have you built the application in debug mode?

Can you post a screenshot of QtCreator when the program has crashed while running in debug mode?

Cheers,
_