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 Q_UNUSED(index);
327 Q_UNUSED(obj);
328}

◆ MODEL_COMMON_INTERFACE_DELETE_THAT_OBJ_IMPL()

MODEL_COMMON_INTERFACE_DELETE_THAT_OBJ_IMPL ( dbe::models::treeselection )

Definition at line 330 of file treeselection.cpp.

331{
332// This is a stub and nothing needs to be done since
333// the real job happens in the slot defined in dbe::models::tree
334 Q_UNUSED(index);
335}

◆ 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 344 of file treeselection.cpp.

345{
346 Q_UNUSED(obj);
347 type_index const mapped_index = this->mapFromSource ( index );
348 emit dataChanged ( mapped_index, mapped_index );
349}

◆ MODEL_COMMON_INTERFACE_UPDATE_THAT_OBJ_IMPL()

MODEL_COMMON_INTERFACE_UPDATE_THAT_OBJ_IMPL ( dbe::models::treeselection )

Definition at line 337 of file treeselection.cpp.

338{
339 Q_UNUSED(obj);
340 type_index const mapped_index = this->mapFromSource ( index );
341 emit dataChanged ( mapped_index, mapped_index );
342}