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

328{
329// This is a stub and nothing needs to be done since
330// the real job happens in the slot defined in dbe::models::tree object from signal for treeselectionmodel
331 Q_UNUSED(index);
332 Q_UNUSED(obj);
333}

◆ MODEL_COMMON_INTERFACE_DELETE_THAT_OBJ_IMPL()

MODEL_COMMON_INTERFACE_DELETE_THAT_OBJ_IMPL ( dbe::models::treeselection )

Definition at line 335 of file treeselection.cpp.

336{
337// This is a stub and nothing needs to be done since
338// the real job happens in the slot defined in dbe::models::tree
339 Q_UNUSED(index);
340}

◆ MODEL_COMMON_INTERFACE_LOOKUP_IMPL()

MODEL_COMMON_INTERFACE_LOOKUP_IMPL ( dbe::models::treeselection )

Definition at line 302 of file treeselection.cpp.

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

◆ MODEL_COMMON_INTERFACE_RENAME_THAT_OBJ_IMPL()

MODEL_COMMON_INTERFACE_RENAME_THAT_OBJ_IMPL ( dbe::models::treeselection )

Definition at line 349 of file treeselection.cpp.

350{
351 Q_UNUSED(obj);
352 type_index const mapped_index = this->mapFromSource ( index );
353 emit dataChanged ( mapped_index, mapped_index );
354}

◆ MODEL_COMMON_INTERFACE_UPDATE_THAT_OBJ_IMPL()

MODEL_COMMON_INTERFACE_UPDATE_THAT_OBJ_IMPL ( dbe::models::treeselection )

Definition at line 342 of file treeselection.cpp.

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