Open documents view: do not switch editor on right-click

Right-clicking opens the context menu, which should not switch editors.

Task-number: QTCREATORBUG-8178
Change-Id: I9c70ba14fa4f80d3fc90fa80954f9f9417a52a98
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Eike Ziller
2014-02-13 11:43:40 +01:00
parent 31ca3d65b2
commit f9f8ac2a6b

View File

@@ -170,15 +170,15 @@ bool OpenEditorsWidget::eventFilter(QObject *obj, QEvent *event)
void OpenEditorsWidget::handlePressed(const QModelIndex &index)
{
if (index.column() == 0)
activateEditor(index);
else if (index.column() == 1)
if (index.column() == 1)
m_delegate->pressedIndex = index;
}
void OpenEditorsWidget::handleClicked(const QModelIndex &index)
{
if (index.column() == 1) { // the funky close button
if (index.column() == 0) {
activateEditor(index);
} else if (index.column() == 1) { // the funky close button
closeEditor(index);
// work around a bug in itemviews where the delegate wouldn't get the QStyle::State_MouseOver