当前位置: 首页>>代码示例>>C++>>正文


C++ CNode::SetNext方法代码示例

本文整理汇总了C++中CNode::SetNext方法的典型用法代码示例。如果您正苦于以下问题:C++ CNode::SetNext方法的具体用法?C++ CNode::SetNext怎么用?C++ CNode::SetNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CNode的用法示例。


在下文中一共展示了CNode::SetNext方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: RemoveOrCopyChildren

void CParentNode::RemoveOrCopyChildren( QVector<CNode*> &children, long nFrom, long nTo, int fRemove )
{
	if( nTo == -1 ) nTo = (long) m_children.size();
	Q_ASSERT( nTo <= (long) m_children.size() );
	Q_ASSERT( nTo >= nFrom );
	children.resize( nTo - nFrom );
	if( children.size() )
	{
		for( long i = 0; i < (long) children.size(); i++ )
		{
			children[ i ] = (fRemove ? m_children[ nFrom + i ] : CreateCopy( m_children[ nFrom + i ] ) );
			children[ i ]->SetParent( NULL );
		}

		children[ 0 ]->SetPrev( NULL );
		children[ children.size() - 1 ]->SetNext( NULL );
		if( fRemove )
		{
			m_children.remove( nFrom, nTo - nFrom );
			CNode *pPrev = (nFrom - 1 > -1 && nFrom - 1 < (long) m_children.size()) ? m_children[ nFrom - 1 ] : NULL;
			CNode *pNext = (nFrom > -1 && nFrom < (long) m_children.size()) ? m_children[ nFrom ] : NULL;
			if( pPrev ) pPrev->SetNext( pNext );
			if( pNext ) pNext->SetPrev( pPrev );
		}
	}
}
开发者ID:Nilis640,项目名称:formulator-mathml,代码行数:26,代码来源:ni_parent.cpp

示例2: RemoveChild

CNode* CParentNode::RemoveChild( long no )
{
	CNode *pNode = GetChild( no );

	if( pNode )
	{
		if( pNode->GetPrev() )
			pNode->GetPrev()->SetNext( pNode->GetNext() );
		if( pNode->GetNext() )
			pNode->GetNext()->SetPrev( pNode->GetPrev() );
		pNode->SetNext( NULL );
		pNode->SetPrev( NULL );
		pNode->SetParent( NULL );

		m_children.remove( no );
	}

	return pNode;
}
开发者ID:Nilis640,项目名称:formulator-mathml,代码行数:19,代码来源:ni_parent.cpp

示例3: InsertChildren

void CParentNode::InsertChildren( QVector<CNode*> &children, long nBefore )
{
	if( children.size() )
	{
		if( nBefore == -1 ) nBefore = (long) m_children.size();
		if( m_children.size() )
		{
			CNode *pPrev = (nBefore - 1 > -1 && nBefore - 1 < (long) m_children.size() ? m_children[ nBefore - 1 ] : NULL);
			CNode *pNext = (nBefore > -1 && nBefore < (long) m_children.size() ? m_children[ nBefore ]: NULL);
			if( pNext ) pNext->SetPrev( children[ children.size() - 1 ] );
			if( pPrev ) pPrev->SetNext( children[ 0 ] );
			children[ children.size() - 1 ]->SetNext( pNext );
			children[ 0 ]->SetPrev( pPrev );
		}
		for( long i = 0; i < children.size(); i++ )
		{
			children[ i ]->SetParent( this );
			children[ i ]->SetLevel( GetLevel() );
			m_children.insert( nBefore + i, children[ i ] );
		}
		children.clear();
	}
}
开发者ID:Nilis640,项目名称:formulator-mathml,代码行数:23,代码来源:ni_parent.cpp


注:本文中的CNode::SetNext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。