From: Soeren Apel Date: Thu, 26 Nov 2020 20:46:58 +0000 (+0100) Subject: DecodeTrace: Add annotation class to hover text X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c583ea05e31967f78870ebbe19f6794e51f512c6;p=pulseview.git DecodeTrace: Add annotation class to hover text --- 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,