Utils: Forward BaseTreeView mouse move events to model

Similar to what press and release do already.

Change-Id: I787d266c8c8cd430114b2448adfb2379a5795a47
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2019-02-13 13:52:18 +01:00
parent babb0166fe
commit dc2e8472e3
2 changed files with 9 additions and 0 deletions

View File

@@ -427,6 +427,14 @@ void BaseTreeView::mousePressEvent(QMouseEvent *ev)
// d->toggleColumnWidth(columnAt(ev->x()));
}
void BaseTreeView::mouseMoveEvent(QMouseEvent *ev)
{
ItemViewEvent ive(ev, this);
QTC_ASSERT(model(), return);
if (!model()->setData(ive.index(), QVariant::fromValue(ive), ItemViewEventRole))
TreeView::mouseMoveEvent(ev);
}
void BaseTreeView::mouseReleaseEvent(QMouseEvent *ev)
{
ItemViewEvent ive(ev, this);

View File

@@ -60,6 +60,7 @@ public:
void setModel(QAbstractItemModel *model) override;
void mousePressEvent(QMouseEvent *ev) override;
void mouseMoveEvent(QMouseEvent *ev) override;
void mouseReleaseEvent(QMouseEvent *ev) override;
void contextMenuEvent(QContextMenuEvent *ev) override;
void showEvent(QShowEvent *ev) override;