forked from qt-creator/qt-creator
CppIncludeHierarchy: Make activation consistent with other views
Use double click activation on double click platforms and fix keyboard activation. Change-Id: I5a36439bb333646f676a78000dfb2570faf3fb1c Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -103,8 +103,7 @@ CppIncludeHierarchyWidget::CppIncludeHierarchyWidget() :
|
|||||||
m_treeView->setModel(m_model);
|
m_treeView->setModel(m_model);
|
||||||
m_treeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
m_treeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||||
m_treeView->setItemDelegate(m_delegate);
|
m_treeView->setItemDelegate(m_delegate);
|
||||||
|
connect(m_treeView, SIGNAL(activated(QModelIndex)), this, SLOT(onItemActivated(QModelIndex)));
|
||||||
connect(m_treeView, SIGNAL(clicked(QModelIndex)), this, SLOT(onItemClicked(QModelIndex)));
|
|
||||||
|
|
||||||
m_includeHierarchyInfoLabel = new QLabel(tr("No include hierarchy available"), this);
|
m_includeHierarchyInfoLabel = new QLabel(tr("No include hierarchy available"), this);
|
||||||
m_includeHierarchyInfoLabel->setAlignment(Qt::AlignCenter);
|
m_includeHierarchyInfoLabel->setAlignment(Qt::AlignCenter);
|
||||||
@@ -157,7 +156,7 @@ void CppIncludeHierarchyWidget::perform()
|
|||||||
showIncludeHierarchy();
|
showIncludeHierarchy();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppIncludeHierarchyWidget::onItemClicked(const QModelIndex &index)
|
void CppIncludeHierarchyWidget::onItemActivated(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
const TextEditor::BaseTextEditorWidget::Link link
|
const TextEditor::BaseTextEditorWidget::Link link
|
||||||
= index.data(LinkRole).value<TextEditor::BaseTextEditorWidget::Link>();
|
= index.data(LinkRole).value<TextEditor::BaseTextEditorWidget::Link>();
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public slots:
|
|||||||
void perform();
|
void perform();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onItemClicked(const QModelIndex &index);
|
void onItemActivated(const QModelIndex &index);
|
||||||
void editorsClosed(QList<Core::IEditor *> editors);
|
void editorsClosed(QList<Core::IEditor *> editors);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user