X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=src%2Fvogleditor%2Fvogleditor_apicalltreeitem.cpp;h=3fd2d7f9792c68979c001d982cb30eda593cefd2;hb=0be623b7893956f940578782eec0b4b123834ff8;hp=32ff10ac4f57a8987177218f83d820bf8b8904c1;hpb=16fc4b597a57c1a1ba5972843587f2b620e8c2ff;p=vogl diff --git a/src/vogleditor/vogleditor_apicalltreeitem.cpp b/src/vogleditor/vogleditor_apicalltreeitem.cpp index 32ff10a..3fd2d7f 100644 --- a/src/vogleditor/vogleditor_apicalltreeitem.cpp +++ b/src/vogleditor/vogleditor_apicalltreeitem.cpp @@ -35,7 +35,8 @@ vogleditor_apiCallTreeItem::vogleditor_apiCallTreeItem(vogleditor_QApiCallTreeMo : m_parentItem(NULL), m_pApiCallItem(NULL), m_pFrameItem(NULL), - m_pModel(pModel) + m_pModel(pModel), + m_localRowIndex(0) { m_columnData[VOGL_ACTC_APICALL] = "API Call"; m_columnData[VOGL_ACTC_INDEX] = "Index"; @@ -51,7 +52,8 @@ vogleditor_apiCallTreeItem::vogleditor_apiCallTreeItem(vogleditor_frameItem* fra : m_parentItem(parent), m_pApiCallItem(NULL), m_pFrameItem(frameItem), - m_pModel(NULL) + m_pModel(NULL), + m_localRowIndex(0) { if (frameItem != NULL) { @@ -71,7 +73,8 @@ vogleditor_apiCallTreeItem::vogleditor_apiCallTreeItem(QString nodeText, vogledi : m_parentItem(parent), m_pApiCallItem(apiCallItem), m_pFrameItem(NULL), - m_pModel(NULL) + m_pModel(NULL), + m_localRowIndex(0) { m_columnData[VOGL_ACTC_APICALL] = nodeText; @@ -122,7 +125,8 @@ vogleditor_apiCallTreeItem* vogleditor_apiCallTreeItem::parent() const void vogleditor_apiCallTreeItem::appendChild(vogleditor_apiCallTreeItem* pChild) { - m_childItems.append(pChild); + pChild->m_localRowIndex = m_childItems.size(); + m_childItems.append(pChild); } int vogleditor_apiCallTreeItem::childCount() const @@ -252,8 +256,5 @@ QVariant vogleditor_apiCallTreeItem::columnData(int column, int role) const int vogleditor_apiCallTreeItem::row() const { // note, this is just the row within the current level of the hierarchy - if (m_parentItem) - return m_parentItem->m_childItems.indexOf(const_cast(this)); - - return 0; + return m_localRowIndex; }