From c583ea05e31967f78870ebbe19f6794e51f512c6 Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Thu, 26 Nov 2020 21:46:58 +0100 Subject: [PATCH] DecodeTrace: Add annotation class to hover text --- pv/views/trace/decodetrace.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pv/views/trace/decodetrace.cpp b/pv/views/trace/decodetrace.cpp index 5b9b3f36..409f1d28 100644 --- a/pv/views/trace/decodetrace.cpp +++ b/pv/views/trace/decodetrace.cpp @@ -1032,8 +1032,17 @@ const QString DecodeTrace::get_annotation_at_point(const QPoint &point) decode_signal_->get_annotation_subset(annotations, r->decode_row, current_segment_, sample_range.first, sample_range.second); - return (annotations.empty()) ? - QString() : annotations[0]->annotations()->front(); + const Annotation* a = annotations.empty() ? nullptr : annotations[0]; + + // Create a string of the format "CLASS: VALUE" + QString s; + if (a) { + if (!a->ann_class_description().isEmpty()) + s = a->ann_class_description() + ": "; + s += a->annotations()->front(); + } + + return s; } void DecodeTrace::create_decoder_form(int index, shared_ptr &dec, -- 2.30.2