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-Url: http://git.code-monkey.de/?p=pulseview.git;a=commitdiff_plain;h=4a8185876c7d4dcb0e940df3077f46c0c98de7f9 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 50e1908..06d4f40 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);