From 4a8185876c7d4dcb0e940df3077f46c0c98de7f9 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Mon, 16 Nov 2015 21:36:20 +0100 Subject: [PATCH] MainBar: Only show "total sampling time" tooltip if supported by device. If the device doesn't support SR_CONF_LIMIT_SAMPLES, the tooltip would always show a sampling time of 0s. --- pv/toolbars/mainbar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp index 50e1908f..06d4f409 100644 --- a/pv/toolbars/mainbar.cpp +++ b/pv/toolbars/mainbar.cpp @@ -586,7 +586,8 @@ void MainBar::on_config_changed() bool MainBar::eventFilter(QObject *watched, QEvent *event) { - if ((watched == &sample_count_ || watched == &sample_rate_) && + if (sample_count_supported_ && + (watched == &sample_count_ || watched == &sample_rate_) && (event->type() == QEvent::ToolTip)) { auto sec = pv::util::Timestamp(sample_count_.value()) / sample_rate_.value(); QHelpEvent *help_event = static_cast(event); -- 2.30.2