forked from qt-creator/qt-creator
Core: do not activate open documents entry on right click
If we activate an entry before we handle the context menu event we might switch into another mode. For example when right clicking on a ui File. Fixes: QTCREATORBUG-30357 Change-Id: I8de78c3a6bbd9d62e2766ccd2059ee3ee4ef0870 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -648,24 +648,12 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
bool userWantsContextMenu(const QMouseEvent *e) const
|
||||
bool userWantsContextMenu(const QMouseEvent *e) const final
|
||||
{
|
||||
// On Windows, we get additional mouse events for the item view when right-clicking,
|
||||
// causing unwanted kit activation (QTCREATORBUG-24156). Let's suppress these.
|
||||
return HostOsInfo::isWindowsHost() && e->button() == Qt::RightButton;
|
||||
}
|
||||
|
||||
void mousePressEvent(QMouseEvent *e) final
|
||||
{
|
||||
if (!userWantsContextMenu(e))
|
||||
BaseTreeView::mousePressEvent(e);
|
||||
}
|
||||
|
||||
void mouseReleaseEvent(QMouseEvent *e) final
|
||||
{
|
||||
if (!userWantsContextMenu(e))
|
||||
BaseTreeView::mouseReleaseEvent(e);
|
||||
}
|
||||
};
|
||||
|
||||
class ComboBoxItem : public TreeItem
|
||||
|
||||
Reference in New Issue
Block a user