* This value will have to get updated if new rows (API calls) can be added / removed, which may undo this optimization,
but when investigating a slowness during searching, the code was often found in this function.
: m_parentItem(NULL),
m_pApiCallItem(NULL),
m_pFrameItem(NULL),
: m_parentItem(NULL),
m_pApiCallItem(NULL),
m_pFrameItem(NULL),
+ m_pModel(pModel),
+ m_localRowIndex(0)
{
m_columnData[VOGL_ACTC_APICALL] = "API Call";
m_columnData[VOGL_ACTC_INDEX] = "Index";
{
m_columnData[VOGL_ACTC_APICALL] = "API Call";
m_columnData[VOGL_ACTC_INDEX] = "Index";
: m_parentItem(parent),
m_pApiCallItem(NULL),
m_pFrameItem(frameItem),
: m_parentItem(parent),
m_pApiCallItem(NULL),
m_pFrameItem(frameItem),
+ m_pModel(NULL),
+ m_localRowIndex(0)
{
if (frameItem != NULL)
{
{
if (frameItem != NULL)
{
: m_parentItem(parent),
m_pApiCallItem(apiCallItem),
m_pFrameItem(NULL),
: m_parentItem(parent),
m_pApiCallItem(apiCallItem),
m_pFrameItem(NULL),
+ m_pModel(NULL),
+ m_localRowIndex(0)
{
m_columnData[VOGL_ACTC_APICALL] = nodeText;
{
m_columnData[VOGL_ACTC_APICALL] = nodeText;
void vogleditor_apiCallTreeItem::appendChild(vogleditor_apiCallTreeItem* pChild)
{
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
}
int vogleditor_apiCallTreeItem::childCount() const
int vogleditor_apiCallTreeItem::row() const
{
// note, this is just the row within the current level of the hierarchy
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<vogleditor_apiCallTreeItem*>(this));
-
- return 0;
+ return m_localRowIndex;
vogleditor_apiCallItem* m_pApiCallItem;
vogleditor_frameItem* m_pFrameItem;
vogleditor_QApiCallTreeModel* m_pModel;
vogleditor_apiCallItem* m_pApiCallItem;
vogleditor_frameItem* m_pFrameItem;
vogleditor_QApiCallTreeModel* m_pModel;
};
#endif // VOGLEDITOR_APICALLTREEITEM_H
};
#endif // VOGLEDITOR_APICALLTREEITEM_H