+void DecodeTrace::on_copy_annotation_to_clipboard()
+{
+ using namespace pv::data::decode;
+
+ if (!selected_row_)
+ return;
+
+ vector<Annotation> *annotations = new vector<Annotation>();
+
+ decode_signal_->get_annotation_subset(*annotations, *selected_row_,
+ current_segment_, selected_sample_range_.first, selected_sample_range_.first);
+
+ if (annotations->empty())
+ return;
+
+ QClipboard *clipboard = QGuiApplication::clipboard();
+ clipboard->setText(annotations->front().annotations().front(), QClipboard::Clipboard);
+
+ if (clipboard->supportsSelection())
+ clipboard->setText(annotations->front().annotations().front(), QClipboard::Selection);
+
+ delete annotations;
+}
+