MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / DetectorTableModel

Method DetectorTableModel

qt/DetectorTableModel.cpp:3–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "DetectorTableModel.h"
2
3DetectorTableModel::DetectorTableModel(QObject* parent) : QAbstractTableModel(parent)
4{
5 detectors.clear();
6
7 /*-----------------------------------------------------*\
8 | Read the detector list from the settings manager |
9 \*-----------------------------------------------------*/
10 json settings = ResourceManager::get()->GetSettingsManager()->GetSettings("Detectors");
11
12 if(settings.contains("detectors"))
13 {
14 for(json::const_iterator it = settings["detectors"].begin(); it != settings["detectors"].end(); it++)
15 {
16 DetectorTableValue new_entry;
17
18 new_entry.key = it.key();
19 new_entry.value = it.value();
20
21 detectors.push_back(new_entry);
22 }
23 }
24
25 /*-----------------------------------------------------*\
26 | If settings contains the detectors list, fill in rows |
27 \*-----------------------------------------------------*/
28 beginInsertRows(QModelIndex(), 0, detectors.size());
29 endInsertRows();
30}
31
32int DetectorTableModel::columnCount(const QModelIndex&) const
33{

Callers

nothing calls this directly

Calls 10

GetSettingsMethod · 0.80
GetSettingsManagerMethod · 0.80
containsMethod · 0.80
getFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
keyMethod · 0.45
valueMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected