]> sigrok.org Git - pulseview.git/commitdiff
MainBar: Only show "total sampling time" tooltip if supported by device.
authorTilman Sauerbeck <redacted>
Mon, 16 Nov 2015 20:36:20 +0000 (21:36 +0100)
committerTilman Sauerbeck <redacted>
Mon, 16 Nov 2015 20:37:48 +0000 (21:37 +0100)
If the device doesn't support SR_CONF_LIMIT_SAMPLES, the tooltip would
always show a sampling time of 0s.

pv/toolbars/mainbar.cpp

index 50e1908fb66031005cefbbadcbc9439461c1ace3..06d4f409b718a77e9546d076d7ebe7b496d6debf 100644 (file)
@@ -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<QHelpEvent*>(event);