Help: Fix crash when using drag&drop with bookmarks

On Windows the combination drag&drop, proxy model and header section
resize mode ResizeToContents leads to a crash in Qt.

Task-number: QTCREATORBUG-17547
Change-Id: I3a763c22b83e43d1c1a222cefb4fbbc56b9082c4
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2017-01-11 10:51:55 +01:00
parent a0125a6e6d
commit 1c5e771bd7

View File

@@ -443,6 +443,10 @@ void BookmarkWidget::setup()
treeView->setDropIndicatorShown(true);
treeView->viewport()->installEventFilter(this);
treeView->setContextMenuPolicy(Qt::CustomContextMenu);
// work around crash on Windows with drag & drop
// in combination with proxy model and ResizeToContents section resize mode
treeView->header()->setSectionResizeMode(QHeaderView::Stretch);
connect(treeView, &TreeView::expanded, this, &BookmarkWidget::expand);
connect(treeView, &TreeView::collapsed, this, &BookmarkWidget::expand);