Add ability to goto comment by double-clicking time.
Also remove some legacy signal-slot connections.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user