MCPcopy Create free account
hub / github.com/comaps/comaps / CreateTreeItem

Method CreateTreeItem

qt/update_dialog.cpp:548–567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546}
547
548QTreeWidgetItem * UpdateDialog::CreateTreeItem(CountryId const & countryId, size_t posInRanking, string matchedBy,
549 QTreeWidgetItem * parent)
550{
551 QString const text = GetNodeName(countryId);
552 auto * const item = new TreeItem(parent, QStringList(text));
553 item->setData(KColumnIndexCountry, Qt::UserRole, QVariant(countryId.c_str()));
554
555 auto const pos = QVariant(static_cast<qint64>(posInRanking));
556 item->setData(KColumnIndexPositionInRanking, Qt::DisplayRole, pos);
557
558 auto const matched = QVariant(matchedBy.c_str());
559 item->setData(KColumnIndexMatchedBy, Qt::DisplayRole, matched);
560
561 if (parent == nullptr)
562 m_tree->addTopLevelItem(item);
563
564 m_treeItemByCountryId.insert(make_pair(countryId, item));
565
566 return item;
567}
568
569vector<QTreeWidgetItem *> UpdateDialog::GetTreeItemsByCountryId(CountryId const & countryId)
570{

Callers

nothing calls this directly

Calls 2

setDataMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected