From: Tilman Sauerbeck Date: Mon, 16 Nov 2015 20:36:20 +0000 (+0100) Subject: MainBar: Only show "total sampling time" tooltip if supported by device. X-Git-Tag: pulseview-0.3.0~39 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4a8185876c7d4dcb0e940df3077f46c0c98de7f9;p=pulseview.git 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. --- 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);