366{
367 model_common_interface * filtermodel = dynamic_cast<model_common_interface *> ( model() );
368 QModelIndex Index = currentIndex();
369
370 if ( !Index.isValid() )
371 {
372 return;
373 }
374
375 if ( filtermodel )
376 {
377
378 try
379 {
380 tref obj = filtermodel->getobject ( Index );
381 std::vector<tref> objects;
382
383 if ( not
obj.is_null() )
384 {
385 objects =
obj.referenced_by (
"*", All );
386 }
387
388 if ( objects.size() > 0 )
389 {
391 ->ReturnSourceModel() );
392 models::treeselection * Selection = new models::treeselection();
394 Selection->SetQueryObjects ( objects );
395 Selection->setFilterRegExp ( "Dummy" );
396 Selection->setSourceModel ( Source );
397
399 tView->setModel ( Selection );
400 tView->setWindowTitle ( QString (
"Objects referencing '%1'" ).arg (
obj.UID().c_str() ) );
401 tView->setSortingEnabled ( true );
402 tView->setAlternatingRowColors ( true );
403 tView->resizeColumnToContents ( 0 );
404 tView->resizeColumnToContents ( 1 );
405 tView->setAttribute(Qt::WA_DeleteOnClose);
406
407 connect ( tView, SIGNAL ( doubleClicked ( QModelIndex ) ),
409
410 tView->show();
411 }
412 else
413 {
414 if ( All )
415 {
416 WARN (
"No references of only composite objects have been found for object",
" ",
417 "with UID:",
obj.UID(),
"of class",
obj.class_name() );
418 }
419 else
420 {
421 WARN (
"No references of objects have been found for object",
" ",
"with UID:",
422 obj.UID(),
"of class",
obj.class_name() );
423 }
424 }
425 }
426 catch ( daq::dbe::cannot_handle_invalid_qmodelindex const & e )
427 {}
428 }
429}
CustomTreeView(QWidget *Parent=nullptr)
Including QT Headers.