Reuse the requestExpansion() signal from the base class

In addition correct the signatures of signals in BaseTreeModel.

Change-Id: I8c49105c9fcc1a6115c5e5c0dc8d9e87ff98d707
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2020-11-17 14:26:08 +01:00
parent 8795ecbf5e
commit 900007e781
3 changed files with 3 additions and 4 deletions

View File

@@ -207,8 +207,8 @@ protected:
void destroyItem(TreeItem *item); // item is destroyed. void destroyItem(TreeItem *item); // item is destroyed.
signals: signals:
void requestExpansion(QModelIndex); void requestExpansion(const QModelIndex &);
void requestCollapse(QModelIndex); void requestCollapse(const QModelIndex &);
protected: protected:
friend class TreeItem; friend class TreeItem;

View File

@@ -152,7 +152,7 @@ TestResultsPane::TestResultsPane(QObject *parent) :
connect(m_treeView, &ResultsTreeView::copyShortcutTriggered, [this] () { connect(m_treeView, &ResultsTreeView::copyShortcutTriggered, [this] () {
onCopyItemTriggered(getTestResult(m_treeView->currentIndex())); onCopyItemTriggered(getTestResult(m_treeView->currentIndex()));
}); });
connect(m_model, &TestResultModel::requestExpansion, [this] (QModelIndex idx) { connect(m_model, &TestResultModel::requestExpansion, [this] (const QModelIndex &idx) {
m_treeView->expand(m_filterModel->mapFromSource(idx)); m_treeView->expand(m_filterModel->mapFromSource(idx));
}); });
connect(TestRunner::instance(), &TestRunner::testRunStarted, connect(TestRunner::instance(), &TestRunner::testRunStarted,

View File

@@ -92,7 +92,6 @@ public:
signals: signals:
void renamed(const Utils::FilePath &oldName, const Utils::FilePath &newName); void renamed(const Utils::FilePath &oldName, const Utils::FilePath &newName);
void requestExpansion(const QModelIndex &index);
private: private:
bool m_filterProjects = false; bool m_filterProjects = false;