I have a problem with some crash of a widget as I do nothing with it! So since it was curious that a widget could crash as it should be inactive, I started to put printf() lines everywhere to determine WHERE it crashed. And my first surprise was to discover that paintEvent() is called many times, actually it is called at regular time steps, even if I do not touch any part of my computer! So why this strange behaviour?
Second it appears that the crash occurs when the indexAt() function of my QAbstractItemView() inherited class returns an invalid QModelIndex(). I suspected that an obvious and valid reimplementation of indexAt() was return QModelIndex(); What is wrong here?
Bookmarks