forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user