From 1c5e771bd759f987d968cab0614296b5b42df2d1 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 11 Jan 2017 10:51:55 +0100 Subject: [PATCH] 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 --- src/shared/help/bookmarkmanager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared/help/bookmarkmanager.cpp b/src/shared/help/bookmarkmanager.cpp index 4d17c9f8eca..f66ba076a40 100644 --- a/src/shared/help/bookmarkmanager.cpp +++ b/src/shared/help/bookmarkmanager.cpp @@ -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);