forked from qt-creator/qt-creator
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: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -56,7 +56,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
BaseTreeView::BaseTreeView(QWidget *parent)
|
BaseTreeView::BaseTreeView(QWidget *parent)
|
||||||
: QTreeView(parent)
|
: Utils::TreeView(parent)
|
||||||
{
|
{
|
||||||
setAttribute(Qt::WA_MacShowFocusRect, false);
|
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||||
setFrameStyle(QFrame::NoFrame);
|
setFrameStyle(QFrame::NoFrame);
|
||||||
@@ -114,14 +114,14 @@ bool BaseTreeView::handleBaseContextAction(QAction *act)
|
|||||||
|
|
||||||
void BaseTreeView::setModel(QAbstractItemModel *model)
|
void BaseTreeView::setModel(QAbstractItemModel *model)
|
||||||
{
|
{
|
||||||
QTreeView::setModel(model);
|
Utils::TreeView::setModel(model);
|
||||||
if (header() && m_alwaysAdjustColumnsAction)
|
if (header() && m_alwaysAdjustColumnsAction)
|
||||||
setAlwaysResizeColumnsToContents(m_alwaysAdjustColumnsAction->isChecked());
|
setAlwaysResizeColumnsToContents(m_alwaysAdjustColumnsAction->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseTreeView::mousePressEvent(QMouseEvent *ev)
|
void BaseTreeView::mousePressEvent(QMouseEvent *ev)
|
||||||
{
|
{
|
||||||
QTreeView::mousePressEvent(ev);
|
Utils::TreeView::mousePressEvent(ev);
|
||||||
if (!indexAt(ev->pos()).isValid())
|
if (!indexAt(ev->pos()).isValid())
|
||||||
resizeColumnsToContents();
|
resizeColumnsToContents();
|
||||||
}
|
}
|
||||||
@@ -147,7 +147,7 @@ void BaseTreeView::headerSectionClicked(int logicalIndex)
|
|||||||
|
|
||||||
void BaseTreeView::reset()
|
void BaseTreeView::reset()
|
||||||
{
|
{
|
||||||
QTreeView::reset();
|
Utils::TreeView::reset();
|
||||||
if (header() && m_alwaysAdjustColumnsAction
|
if (header() && m_alwaysAdjustColumnsAction
|
||||||
&& m_alwaysAdjustColumnsAction->isChecked())
|
&& m_alwaysAdjustColumnsAction->isChecked())
|
||||||
resizeColumnsToContents();
|
resizeColumnsToContents();
|
||||||
|
|||||||
@@ -32,11 +32,11 @@
|
|||||||
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include <QTreeView>
|
#include "itemviews.h"
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT BaseTreeView : public QTreeView
|
class QTCREATOR_UTILS_EXPORT BaseTreeView : public Utils::TreeView
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|||||||
@@ -714,7 +714,7 @@ void BreakTreeView::keyPressEvent(QKeyEvent *ev)
|
|||||||
update(id);
|
update(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QTreeView::keyPressEvent(ev);
|
BaseTreeView::keyPressEvent(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BreakTreeView::mouseDoubleClickEvent(QMouseEvent *ev)
|
void BreakTreeView::mouseDoubleClickEvent(QMouseEvent *ev)
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ void SnapshotTreeView::keyPressEvent(QKeyEvent *ev)
|
|||||||
if (idx.column() == 0)
|
if (idx.column() == 0)
|
||||||
removeSnapshot(idx.row());
|
removeSnapshot(idx.row());
|
||||||
}
|
}
|
||||||
QTreeView::keyPressEvent(ev);
|
BaseTreeView::keyPressEvent(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SnapshotTreeView::contextMenuEvent(QContextMenuEvent *ev)
|
void SnapshotTreeView::contextMenuEvent(QContextMenuEvent *ev)
|
||||||
|
|||||||
@@ -994,7 +994,7 @@ void WatchTreeView::setModel(QAbstractItemModel *model)
|
|||||||
SLOT(handleItemIsExpanded(QModelIndex)));
|
SLOT(handleItemIsExpanded(QModelIndex)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchTreeView::rowClicked(const QModelIndex &index)
|
void WatchTreeView::rowActivated(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
currentEngine()->watchDataSelected(currentEngine()->watchHandler()->watchData(index)->iname);
|
currentEngine()->watchDataSelected(currentEngine()->watchHandler()->watchData(index)->iname);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public:
|
|||||||
explicit WatchTreeView(Type type, QWidget *parent = 0);
|
explicit WatchTreeView(Type type, QWidget *parent = 0);
|
||||||
Type type() const { return m_type; }
|
Type type() const { return m_type; }
|
||||||
void setModel(QAbstractItemModel *model);
|
void setModel(QAbstractItemModel *model);
|
||||||
void rowClicked(const QModelIndex &index);
|
void rowActivated(const QModelIndex &index);
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|||||||
Reference in New Issue
Block a user