BaseTreeView: Disable resizing columns by clicking on the background

Resizing columns by clicking on the empty space seems to be
controversial, perhaps because it also has the side-effect of
resetting the column resize behavior to "automatic"

Let's try without for a while.

Task-number: QTCREATORBUG-19169
Change-Id: I0b480d6857dba9f247fa3537273073e3c65712d2
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2018-02-05 10:29:03 +01:00
parent d3eb585db9
commit ba17b58ede

View File

@@ -309,9 +309,11 @@ void BaseTreeView::setModel(QAbstractItemModel *m)
void BaseTreeView::mousePressEvent(QMouseEvent *ev) void BaseTreeView::mousePressEvent(QMouseEvent *ev)
{ {
TreeView::mousePressEvent(ev); TreeView::mousePressEvent(ev);
const QModelIndex mi = indexAt(ev->pos()); // Resizing columns by clicking on the empty space seems to be controversial.
if (!mi.isValid()) // Let's try without for a while.
d->toggleColumnWidth(columnAt(ev->x())); // const QModelIndex mi = indexAt(ev->pos());
// if (!mi.isValid())
// d->toggleColumnWidth(columnAt(ev->x()));
} }
void BaseTreeView::contextMenuEvent(QContextMenuEvent *ev) void BaseTreeView::contextMenuEvent(QContextMenuEvent *ev)