Use single QVariant tagging on RDTreeWidgetItem instead of setData

* It saves on allocating a vector of vectors and in most cases is all we
  need.
This commit is contained in:
baldurk
2017-04-21 18:38:47 +01:00
parent f65f5ea9da
commit 605fd4dcc5
10 changed files with 114 additions and 101 deletions
+2 -2
View File
@@ -94,7 +94,7 @@ void APIInspector::on_apiEvents_itemSelectionChanged()
if(!node)
return;
APIEvent ev = ui->apiEvents->selectedItems()[0]->data(0, Qt::UserRole).value<APIEvent>();
APIEvent ev = node->tag().value<APIEvent>();
if(ev.callstack.count > 0)
{
@@ -152,7 +152,7 @@ void APIInspector::fillAPIView()
if(ev.eventID == draw->eventID)
root->setBold(true);
root->setData(0, Qt::UserRole, QVariant::fromValue(ev));
root->setTag(QVariant::fromValue(ev));
ui->apiEvents->addTopLevelItem(root);