diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-18 15:27:02 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-18 15:29:09 (GMT) |
commit | 3f83ef0a8abc5d1365c67337357564a8d478b1c1 (patch) | |
tree | 9b7881c70b9a151128552834375ace9c08049e95 /src/gui/itemviews | |
parent | c38e1a53cee2178f9270b515826bf907654b1964 (diff) | |
download | Qt-3f83ef0a8abc5d1365c67337357564a8d478b1c1.zip Qt-3f83ef0a8abc5d1365c67337357564a8d478b1c1.tar.gz Qt-3f83ef0a8abc5d1365c67337357564a8d478b1c1.tar.bz2 |
Fixed a crash when setting twice the same viewmode on a QListView
autotest will detect the problem
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r-- | src/gui/itemviews/qlistview.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp index ea38f5f..e9e365f 100644 --- a/src/gui/itemviews/qlistview.cpp +++ b/src/gui/itemviews/qlistview.cpp @@ -458,6 +458,8 @@ QSize QListView::gridSize() const void QListView::setViewMode(ViewMode mode) { Q_D(QListView); + if (d->viewMode == mode) + return; d->viewMode = mode; if (mode == ListMode) { @@ -1963,7 +1965,7 @@ QListViewPrivate::QListViewPrivate() movement(QListView::Static), resizeMode(QListView::Fixed), layoutMode(QListView::SinglePass), - viewMode(QListView::ListMode), + viewMode(QListView::IconMode), //this will ensure the first initialization to ListView modeProperties(0), column(0), uniformItemSizes(false), |