예제 #1
0
파일: ktreewidget.cpp 프로젝트: kxtry/kxfw
void KTreeWidgetPrivate::itemsInserted( const QList<qint64>& ids )
{
	Q_Q(KTreeWidget);
	bool bupdate = false;
	for(int i = 0; i < ids.count(); i++)
	{
		if(isNodeVisible(ids.at(i)))
		{
			bupdate = true;
			break;
		}
	}

	if(bupdate)
	{
		updateList();
	}
	else if(m_styleTree & KTreeWidget::HasBranch)
	{
		for(int i = 0; i < ids.size(); i++)
		{
			qint64 nodeid = m_model->parent(ids.at(i));
			int count = m_model->childCount(nodeid);
			if(count == 1)
			{
				KTreeItem *pli = m_widgetItems.value(nodeid);
				if(pli)
				{
					pli->update();
				}
			}
		}
	}
}
예제 #2
0
파일: Scene.cpp 프로젝트: 1timmy/GamePlay
Node* Scene::findNextVisibleSibling(Node* node)
{
    while (node != NULL && !isNodeVisible(node))
    {
        node = node->getNextSibling();
    }
    return node;
}