DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
treeselection.cpp File Reference
#include "dbe/treeselection.hpp"
#include "dbe/messenger.hpp"
#include "dbe/tree.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 304 of file treeselection.cpp.

305{
306 // This is a stub and nothing needs to be done since
307 // the real job happens in the slot defined in dbe::models::tree object from signal for treeselectionmodel
308 Q_UNUSED(index);
309 Q_UNUSED(obj);
310}

◆ MODEL_COMMON_INTERFACE_DELETE_THAT_OBJ_IMPL()

MODEL_COMMON_INTERFACE_DELETE_THAT_OBJ_IMPL ( dbe::models::treeselection )

Definition at line 312 of file treeselection.cpp.

313{
314 // This is a stub and nothing needs to be done since
315 // the real job happens in the slot defined in dbe::models::tree
316 Q_UNUSED(index);
317}

◆ MODEL_COMMON_INTERFACE_LOOKUP_IMPL()

MODEL_COMMON_INTERFACE_LOOKUP_IMPL ( dbe::models::treeselection )

Definition at line 282 of file treeselection.cpp.

283{
284 if (dbe::treenode* classnode = confaccessor::gethandler()->getnode(QString::fromStdString(obj.class_name()))) {
285
286 auto found = [&obj, classnode](int i) {
287 return obj.UID() == classnode->GetChild(i)->GetData(0).toString().toStdString();
288 };
289
290 int i = 0;
291 int const childs = classnode->ChildCount();
292
293 for (; i < childs and not found(i); ++i)
294 ;
295
296 return i == childs ? QModelIndex() : index(i, 0, QModelIndex());
297 }
298
299 return QModelIndex();
300}

◆ MODEL_COMMON_INTERFACE_RENAME_THAT_OBJ_IMPL()

MODEL_COMMON_INTERFACE_RENAME_THAT_OBJ_IMPL ( dbe::models::treeselection )

Definition at line 326 of file treeselection.cpp.

327{
328 Q_UNUSED(obj);
329 type_index const mapped_index = this->mapFromSource(index);
330 emit dataChanged(mapped_index, mapped_index);
331}

◆ MODEL_COMMON_INTERFACE_UPDATE_THAT_OBJ_IMPL()

MODEL_COMMON_INTERFACE_UPDATE_THAT_OBJ_IMPL ( dbe::models::treeselection )

Definition at line 319 of file treeselection.cpp.

320{
321 Q_UNUSED(obj);
322 type_index const mapped_index = this->mapFromSource(index);
323 emit dataChanged(mapped_index, mapped_index);
324}