DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
treeselection.cpp File Reference
#include "dbe/tree.hpp"
#include "dbe/treeselection.hpp"
#include "dbe/messenger.hpp"
Include dependency graph for treeselection.cpp:

Go to the source code of this file.

Functions

 MODEL_COMMON_INTERFACE_LOOKUP_IMPL (dbe::models::treeselection)
 
 MODEL_COMMON_INTERFACE_CREATE_THAT_OBJ_IMPL (dbe::models::treeselection)
 
 MODEL_COMMON_INTERFACE_DELETE_THAT_OBJ_IMPL (dbe::models::treeselection)
 
 MODEL_COMMON_INTERFACE_UPDATE_THAT_OBJ_IMPL (dbe::models::treeselection)
 
 MODEL_COMMON_INTERFACE_RENAME_THAT_OBJ_IMPL (dbe::models::treeselection)
 

Function Documentation

◆ MODEL_COMMON_INTERFACE_CREATE_THAT_OBJ_IMPL()

MODEL_COMMON_INTERFACE_CREATE_THAT_OBJ_IMPL ( dbe::models::treeselection )

Definition at line 322 of file treeselection.cpp.

323{
324// This is a stub and nothing needs to be done since
325// the real job happens in the slot defined in dbe::models::tree object from signal for treeselectionmodel
326}

◆ MODEL_COMMON_INTERFACE_DELETE_THAT_OBJ_IMPL()

MODEL_COMMON_INTERFACE_DELETE_THAT_OBJ_IMPL ( dbe::models::treeselection )

Definition at line 328 of file treeselection.cpp.

329{
330// This is a stub and nothing needs to be done since
331// the real job happens in the slot defined in dbe::models::tree
332}

◆ MODEL_COMMON_INTERFACE_LOOKUP_IMPL()

MODEL_COMMON_INTERFACE_LOOKUP_IMPL ( dbe::models::treeselection )

Definition at line 297 of file treeselection.cpp.

298{
299 if ( dbe::treenode * classnode = confaccessor::gethandler()->getnode (
300 QString::fromStdString ( obj.class_name() ) ) )
301 {
302
303 auto found = [&obj, classnode] ( int i )
304 {
305 return obj.UID() == classnode->GetChild ( i )->GetData ( 0 ).toString().toStdString();
306 };
307
308 int i = 0;
309 int const childs = classnode->ChildCount();
310
311 for ( ; i < childs and not found ( i ); ++i )
312 ;
313
314 return i == childs ? QModelIndex() : index ( i, 0, QModelIndex() );
315 }
316
317 return QModelIndex();
318}

◆ MODEL_COMMON_INTERFACE_RENAME_THAT_OBJ_IMPL()

MODEL_COMMON_INTERFACE_RENAME_THAT_OBJ_IMPL ( dbe::models::treeselection )

Definition at line 340 of file treeselection.cpp.

341{
342 type_index const mapped_index = this->mapFromSource ( index );
343 emit dataChanged ( mapped_index, mapped_index );
344}

◆ MODEL_COMMON_INTERFACE_UPDATE_THAT_OBJ_IMPL()

MODEL_COMMON_INTERFACE_UPDATE_THAT_OBJ_IMPL ( dbe::models::treeselection )

Definition at line 334 of file treeselection.cpp.

335{
336 type_index const mapped_index = this->mapFromSource ( index );
337 emit dataChanged ( mapped_index, mapped_index );
338}