389{
394
396
397 {
398 QString name = QString::fromStdString ( attr.p_name );
399
400 if ( attr.p_is_multi_value )
401 {
402 widgets::editors::multiattr * widget = new widgets::editors::multiattr ( attr, this,
403 true );
405
408 connect ( widget, SIGNAL ( signal_value_change() ),
this, SLOT (
UpdateActions() ),
409 Qt::UniqueConnection );
410 connect ( widget, SIGNAL ( signal_value_change() ),
this, SLOT (
ObjectChanged() ),
411 Qt::UniqueConnection );
413 }
414 else
415 {
416 switch ( attr.p_type )
417 {
418
420
422 {
423 widgets::editors::combo * Widget = new widgets::editors::combo ( attr, this, true );
427 connect ( Widget->Combo, SIGNAL ( activated ( QString ) ),
this, SLOT (
UpdateActions() ),
428 Qt::UniqueConnection );
429 connect ( Widget, SIGNAL ( signal_value_change() ),
this, SLOT (
ObjectChanged() ),
430 Qt::UniqueConnection );
432 break;
433 }
434
436
438
440
442
444
446
448
450
452
454 {
455 widgets::editors::numericattr * Widget = new widgets::editors::numericattr ( attr, this,
456 true );
460 connect ( Widget, SIGNAL ( signal_value_change() ),
this, SLOT (
UpdateActions() ),
461 Qt::UniqueConnection );
462 connect ( Widget, SIGNAL ( signal_value_change() ),
this, SLOT (
ObjectChanged() ),
463 Qt::UniqueConnection );
465 break;
466 }
467
469
471
473 {
474 widgets::editors::stringattr * Widget = new widgets::editors::stringattr ( attr, this,
475 true );
479 connect ( Widget, SIGNAL ( signal_value_change() ),
this, SLOT (
UpdateActions() ),
480 Qt::UniqueConnection );
481 connect ( Widget, SIGNAL ( signal_value_change() ),
this, SLOT (
ObjectChanged() ),
482 Qt::UniqueConnection );
484 break;
485 }
486
488 {
489 widgets::editors::combo * Widget = new widgets::editors::combo ( attr, this, true );
493 connect ( Widget->Combo, SIGNAL ( activated ( QString ) ),
this, SLOT (
UpdateActions() ),
494 Qt::UniqueConnection );
495 connect ( Widget, SIGNAL ( signal_value_change() ),
this, SLOT (
ObjectChanged() ),
496 Qt::UniqueConnection );
498 break;
499 }
500 }
501 }
502 }
503
505 relations )
506 {
507 widgets::editors::relation * widget = new widgets::editors::relation ( arelation, this,
508 true );
509 QString name = QString::fromStdString ( arelation.p_name );
511
513 {
514 std::vector<tref> DataList;
515
517 {
518 try
519 {
520 DataList.push_back (
521 dbegraph::linked::through::relation<tref> (
Object(), arelation ) );
522 }
523 catch ( daq::dbe::config_object_retrieval_result_is_null const & e )
524 {
525
526 }
527 }
528 else
529 {
530 DataList = dbegraph::linked::through::relation<std::vector<tref>> (
Object(), arelation );
531 }
532
533 for (
tref const & i : DataList )
534 {
535 if ( not i.is_null() )
536 {
537 Data.push_back ( QString::fromStdString ( i.UID() ) );
538 }
539 }
540 }
541
542 widget->setdata ( Data );
543 widget->SetEditor();
546 connect ( widget, SIGNAL ( signal_value_change() ),
this, SLOT (
UpdateActions() ),
547 Qt::UniqueConnection );
548 connect ( widget, SIGNAL ( signal_value_change() ),
this, SLOT (
ObjectChanged() ),
549 Qt::UniqueConnection );
551 Qt::UniqueConnection );
552 connect (
this, SIGNAL (
LoadedInitials() ), widget, SLOT ( slot_set_initial_loaded() ),
553 Qt::UniqueConnection );
556 }
557}
void set_attribute_widget(dunedaq::conffwk::attribute_t const &, widgets::editors::base *)
void set_tooltip(dunedaq::conffwk::attribute_t const &, widgets::editors::base *)
void ResetObjectChanged()
void register_attribute_widget(QString const &name, widgets::editors::base *widget)
void register_relation_widget(QString const &name, widgets::editors::base *widget)
static dunedaq::conffwk::class_t definition(std::string const &cn, bool direct_only)
std::vector< T > attributes(tref const &item)
std::vector< T > relations(tref const &item)
bool is_simple(dunedaq::conffwk::relationship_t const &)
inner::configobject::tref tref
const std::vector< attribute_t > p_attributes
const std::vector< relationship_t > p_relationships