Commit 406ccbde authored by Daniel Teske's avatar Daniel Teske

DebuggerViews: Fix keyboard navigation on OS X

Also fix WatchTreeView to use double click activation like every other
debugger view.

Change-Id: Idabe21e12d38d59bef66b7d9855a7fe97089dd8f
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent b0e137f0
......@@ -56,7 +56,7 @@ public:
};
BaseTreeView::BaseTreeView(QWidget *parent)
: QTreeView(parent)
: Utils::TreeView(parent)
{
setAttribute(Qt::WA_MacShowFocusRect, false);
setFrameStyle(QFrame::NoFrame);
......@@ -114,14 +114,14 @@ bool BaseTreeView::handleBaseContextAction(QAction *act)
void BaseTreeView::setModel(QAbstractItemModel *model)
{
QTreeView::setModel(model);
Utils::TreeView::setModel(model);
if (header() && m_alwaysAdjustColumnsAction)
setAlwaysResizeColumnsToContents(m_alwaysAdjustColumnsAction->isChecked());
}
void BaseTreeView::mousePressEvent(QMouseEvent *ev)
{
QTreeView::mousePressEvent(ev);
Utils::TreeView::mousePressEvent(ev);
if (!indexAt(ev->pos()).isValid())
resizeColumnsToContents();
}
......@@ -147,7 +147,7 @@ void BaseTreeView::headerSectionClicked(int logicalIndex)
void BaseTreeView::reset()
{
QTreeView::reset();
Utils::TreeView::reset();
if (header() && m_alwaysAdjustColumnsAction
&& m_alwaysAdjustColumnsAction->isChecked())
resizeColumnsToContents();
......
......@@ -32,11 +32,11 @@
#include "utils_global.h"
#include <QTreeView>
#include "itemviews.h"
namespace Utils {
class QTCREATOR_UTILS_EXPORT BaseTreeView : public QTreeView
class QTCREATOR_UTILS_EXPORT BaseTreeView : public Utils::TreeView
{
Q_OBJECT
......
......@@ -714,7 +714,7 @@ void BreakTreeView::keyPressEvent(QKeyEvent *ev)
update(id);
}
}
QTreeView::keyPressEvent(ev);
BaseTreeView::keyPressEvent(ev);
}
void BreakTreeView::mouseDoubleClickEvent(QMouseEvent *ev)
......
......@@ -77,7 +77,7 @@ void SnapshotTreeView::keyPressEvent(QKeyEvent *ev)
if (idx.column() == 0)
removeSnapshot(idx.row());
}
QTreeView::keyPressEvent(ev);
BaseTreeView::keyPressEvent(ev);
}
void SnapshotTreeView::contextMenuEvent(QContextMenuEvent *ev)
......
......@@ -994,7 +994,7 @@ void WatchTreeView::setModel(QAbstractItemModel *model)
SLOT(handleItemIsExpanded(QModelIndex)));
}
void WatchTreeView::rowClicked(const QModelIndex &index)
void WatchTreeView::rowActivated(const QModelIndex &index)
{
currentEngine()->watchDataSelected(currentEngine()->watchHandler()->watchData(index)->iname);
}
......
......@@ -51,7 +51,7 @@ public:
explicit WatchTreeView(Type type, QWidget *parent = 0);
Type type() const { return m_type; }
void setModel(QAbstractItemModel *model);
void rowClicked(const QModelIndex &index);
void rowActivated(const QModelIndex &index);
void reset();
public slots:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment