Details
-
Bug
-
Resolution: Duplicate
-
P1: Critical
-
4.6.0, 4.7.3
-
None
-
Ubuntu, GNOME (but reproducible on other platforms too)
Description
The following program can easily be made to crash by resizing the list view in a certain way:
#include <QApplication> #include <QListView> #include <QStringListModel> int main(int argc, char *argv[]) { QApplication a(argc, argv); QStringListModel model; QStringList list; for (int i = 0; i < 7; ++i) list.append(QString::number(i).repeated(12)); model.setStringList(list); QListView w; w.setModel(&model); w.show(); return a.exec(); }
The "certain way" seems to be to resize the view in such a way that makes one of the scrollbars disappear while making the other scrollbar appear. It's easy to do when you resize it fast with the bottom-right corner moving close by the bottom-right of the last entry in the list.
The crash happens due to infinite recursion in some layout code. A backtrace is attached.
The above is a small example reproducing the issue, after encountering it in both Qt Creator (with the "Insert variable" window in the External Tools settings) and in my own tile map editor project (with a QUndoView in a QDockWidget).
Note that resizing is not the only way to trigger the issue. In my tile map editor it most frequently happens when a new entry is added to the list (see http://sourceforge.net/apps/mantisbt/tiled/view.php?id=67 for an unfortunately incomplete backtrace, that was triggered by a new entry appearing in the QUndoView).
Attachments
Issue Links
- is replaced by
-
QTBUG-14712 QListView infinite recursion
- Closed