fixed double click problem on files

This commit is contained in:
csoler 2020-06-06 21:51:40 +02:00
parent fecd4369ec
commit baf7b06e4c
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
4 changed files with 29 additions and 499 deletions

View file

@ -24,6 +24,25 @@
RSTreeView::RSTreeView(QWidget *parent) : QTreeView(parent)
{
setMouseTracking(false); // normally the default, but who knows if it's not goign to change in the future.
}
void RSTreeView::mouseMoveEvent(QMouseEvent *e)
{
QModelIndex idx = indexAt(e->pos());
if(idx != selectionModel()->currentIndex())
selectionModel()->setCurrentIndex(idx,QItemSelectionModel::ClearAndSelect);
QTreeView::mouseMoveEvent(e);
}
void RSTreeView::setAutoSelect(bool b)
{
if(b)
setMouseTracking(true);
else
setMouseTracking(false);
}
void RSTreeView::resizeEvent(QResizeEvent *e)