diff --git a/DRAMSys/traceAnalyzer/businessObjects/commentmodel.cpp b/DRAMSys/traceAnalyzer/businessObjects/commentmodel.cpp index 940cd07e..ebe15216 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/commentmodel.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/commentmodel.cpp @@ -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(index.column()) == Column::Time) + Q_EMIT gotoCommentTriggered(index); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/commentmodel.h b/DRAMSys/traceAnalyzer/businessObjects/commentmodel.h index f540663a..93249781 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/commentmodel.h +++ b/DRAMSys/traceAnalyzer/businessObjects/commentmodel.h @@ -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; diff --git a/DRAMSys/traceAnalyzer/presentation/tracescroller.cpp b/DRAMSys/traceAnalyzer/presentation/tracescroller.cpp index ef412d89..feaab60e 100644 --- a/DRAMSys/traceAnalyzer/presentation/tracescroller.cpp +++ b/DRAMSys/traceAnalyzer/presentation/tracescroller.cpp @@ -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() diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index bca568d4..324a1a2a 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -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()