MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / applyFilter

Method applyFilter

pj_plotting/widget/src/CurveEditor.cpp:492–502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490}
491
492void CurveEditor::applyFilter() {
493 const QString needle = ui_->lineEditCurvesFilter->text().trimmed();
494 for (int i = 0; i < ui_->listWidget->count(); ++i) {
495 QListWidgetItem* item = ui_->listWidget->item(i);
496 const QString curve_name = item->data(kCurveNameRole).toString();
497 const QString display_name = item->data(kCurveDisplayNameRole).toString();
498 const bool match = needle.isEmpty() || curve_name.contains(needle, Qt::CaseInsensitive) ||
499 display_name.contains(needle, Qt::CaseInsensitive);
500 item->setHidden(!match);
501 }
502}
503
504bool CurveEditor::eventFilter(QObject* watched, QEvent* event) {
505 const QEvent::Type type = event->type();

Callers 2

applyToSelectedMethod · 0.45
TESTFunction · 0.45

Calls 6

toStringMethod · 0.80
textMethod · 0.45
countMethod · 0.45
dataMethod · 0.45
isEmptyMethod · 0.45
containsMethod · 0.45

Tested by 1

TESTFunction · 0.36