MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / TemplateTableModel

Method TemplateTableModel

src/templates/template_table_model.cpp:70–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68TemplateTableModel::~TemplateTableModel() = default;
69
70TemplateTableModel::TemplateTableModel(Map& map, MapView& view, QObject* parent)
71: QAbstractTableModel(parent)
72, map(map)
73, view(view)
74{
75 connect(&map, &Map::firstFrontTemplateAboutToBeChanged, this, &TemplateTableModel::onFirstFrontTemplateAboutToBeChanged);
76 connect(&map, &Map::firstFrontTemplateChanged, this, &TemplateTableModel::onFirstFrontTemplateChanged);
77 connect(&map, &Map::templateAboutToBeAdded, this, &TemplateTableModel::onTemplateAboutToBeAdded);
78 connect(&map, &Map::templateAdded, this, &TemplateTableModel::onTemplateAdded);
79 connect(&map, &Map::templateChanged, this, &TemplateTableModel::onTemplateChanged);
80 connect(&map, &Map::templateAboutToBeMoved, this, &TemplateTableModel::onTemplateAboutToBeMoved);
81 connect(&map, &Map::templateMoved, this, &TemplateTableModel::onTemplateMoved);
82 connect(&map, &Map::templateAboutToBeDeleted, this, &TemplateTableModel::onTemplateAboutToBeDeleted);
83 connect(&map, &Map::templateDeleted, this, &TemplateTableModel::onTemplateDeleted);
84
85 for (auto i = 0, last = map.getNumTemplates(); i < last; ++i)
86 {
87 auto* temp = map.getTemplate(i);
88 connect(temp, &Template::templateStateChanged, this, &TemplateTableModel::onTemplateStateChanged);
89 }
90}
91
92
93void TemplateTableModel::setCheckBoxDecorator(QVariant decorator)

Callers

nothing calls this directly

Calls 2

getNumTemplatesMethod · 0.80
getTemplateMethod · 0.45

Tested by

no test coverage detected