425{
426 QString ClassName =
ui->ClassCombo->currentText();
427 bool SubClasses =
ui->SubclassesCheckBox->isChecked();
428
430 ClassName.toStdString(), SubClasses );
431
432 std::vector<dref> candidates;
433 std::copy ( tmprefs.begin(), tmprefs.end(), std::back_inserter ( candidates ) );
434
435 if ( !candidates.empty() )
436 {
437 filter ( candidates, ClassName );
438 }
439
440 if ( candidates.empty() )
441 {
442 QMessageBox::information ( this, tr ( "Message" ), tr ( "No objects match filter!" ) );
443 }
444 else
445 {
446 int NumberOfColumns = 1;
447 bool AttributeEnabled = false;
448 bool RelationshipEnabled = false;
449
450 if (
ui->AttributeComboBox->isEnabled() )
451 {
452 AttributeEnabled = true;
453 NumberOfColumns++;
454 }
455
456 if (
ui->RelationshipComboBox->isEnabled() )
457 {
458 RelationshipEnabled = true;
459 NumberOfColumns++;
460 }
461
462 m_filter_table = std::unique_ptr<QTableWidget> (
new QTableWidget() );
463 m_filter_table->setWindowTitle ( tr (
"Objects matching filter" ) );
466
467 for ( size_t i = 0; i < candidates.size(); i++ )
468 {
469 QTableWidgetItem * AttributeValue;
470 QTableWidgetItem * RelationshipValue;
471
472 QTableWidgetItem * ObjectUid = new QTableWidgetItem (
473 tr ( "%1@%2" ).arg ( candidates.at ( i ).UID().c_str() ).arg (
474 candidates.at ( i ).class_name().c_str() ) );
476
477 if ( AttributeEnabled )
478 {
480 ui->AttributeComboBox->currentText(), ClassName );
481
482 QStringList AttributeValueList
483 {
485 Attribute ) };
486
487 AttributeValue = new QTableWidgetItem ( AttributeValueList.join ( " " ) );
489 }
490
491 if ( RelationshipEnabled )
492 {
494 ui->RelationshipComboBox->currentText(), ClassName );
495
496 QStringList RelationshipList
497 {
498 dbegraph::linked::through::relation<QStringList> (
499 candidates.at ( i ).ref(), Relationship ) };
500
501 RelationshipValue = new QTableWidgetItem ( RelationshipList.join ( " " ) );
503 }
504 }
505
506 QStringList Headers;
507 Headers << "Object Id";
508
509 if ( AttributeEnabled )
510 {
511 Headers <<
ui->AttributeComboBox->currentText();
512 }
513
514 if ( RelationshipEnabled )
515 {
516 Headers <<
ui->RelationshipComboBox->currentText();
517 }
518
520
522 HeaderView->setStretchLastSection ( true );
525 }
526}
static std::vector< dbe::inner::configobject::tref > objects(std::string const &cname, bool const keep_inherited=true)
dunedaq::conffwk::relationship_t match(T const &, T const &)
dunedaq::conffwk::attribute_t attributematch(QString const &, QString const &)