Add ability to goto comment by double-clicking time.

Also remove some legacy signal-slot connections.
This commit is contained in:
2021-09-13 10:34:10 +02:00
parent 3157f6a145
commit 1ad53a354f
4 changed files with 15 additions and 6 deletions

View File

@@ -280,3 +280,12 @@ bool CommentModel::eventFilter(QObject *object, QEvent *event)
return false;
}
void CommentModel::rowDoubleClicked(const QModelIndex &index)
{
if (!index.isValid())
return;
if (static_cast<Column>(index.column()) == Column::Time)
Q_EMIT gotoCommentTriggered(index);
}

View File

@@ -87,6 +87,9 @@ public:
QModelIndex hoveredComment(Timespan timespan) const;
public Q_SLOTS:
void rowDoubleClicked(const QModelIndex &index);
protected:
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;

View File

@@ -130,12 +130,6 @@ void TraceScroller::connectNavigatorQ_SIGNALS()
{
QObject::connect(navigator, SIGNAL(currentTraceTimeChanged()), this,
SLOT(currentTraceTimeChanged()));
QObject::connect(navigator, SIGNAL(commentsChanged()), this,
SLOT(commentsChanged()));
QObject::connect(navigator, SIGNAL(selectedCommentsChanged()), this,
SLOT(commentsChanged()));
QObject::connect(navigator, SIGNAL(selectedTransactionsChanged()), this,
SLOT(selectedTransactionsChanged()));
}
Timespan TraceScroller::GetCurrentTimespan()

View File

@@ -176,6 +176,9 @@ void TraceFileTab::setUpCommentView()
ui->commentView->edit(index);
ui->commentView->scrollTo(index);
});
QObject::connect(ui->commentView, &QTableView::doubleClicked,
commentModel, &CommentModel::rowDoubleClicked);
}
void TraceFileTab::tracefileChanged()