コード例 #1
0
ファイル: DuelNode.cpp プロジェクト: jiazhipeng03/Duel-Engine
	DNode* DNode::removeChild( DNode* n )
	{
		if (n != NULL)
		{
			ChildSet::iterator	i = mChildren.find(n);
			if (i != mChildren.end())
			{
				cancelUpdate(n);
				mChildren.erase(i);
				n->setParent(NULL);
			}
		}
		return n;
	}
コード例 #2
0
    //-----------------------------------------------------------------------
    Node* Node::removeChild(Node* child)
    {
        if (child)
        {
            ChildNodeMap::iterator i = mChildren.find(child->getName());
            // ensure it's our child
            if (i != mChildren.end() && i->second == child)
            {
                // cancel any pending update
                cancelUpdate(child);

                mChildren.erase(i);
                child->setParent(NULL);
            }
        }
        return child;
    }
コード例 #3
0
ファイル: DuelNode.cpp プロジェクト: jiazhipeng03/Duel-Engine
	DNode* DNode::removeChild( uint32 index )
	{
		DNode* ret;
		assert(index < getChildCount());
		ChildSet::iterator	i = mChildren.begin();
		for (uint32 j = 0; j < index; ++j)
		{
			i++;
		}
		if (i != mChildren.end())
		{
			ret = *i;
			cancelUpdate(ret);
			(ret)->mParent = NULL;
			signalDetached(this, ret);
			mChildren.erase(i);
			return ret;
		}
		return NULL;
	}
コード例 #4
0
    //-----------------------------------------------------------------------
    Node* Node::removeChild(const String& name)
    {
        ChildNodeMap::iterator i = mChildren.find(name);

        if (i == mChildren.end())
        {
            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Child node named " + name +
                " does not exist.", "Node::removeChild");
        }

        Node* ret = i->second;
        // Cancel any pending update
        cancelUpdate(ret);

        mChildren.erase(i);
        ret->setParent(NULL);

        return ret;


    }
コード例 #5
0
ファイル: DuelNode.cpp プロジェクト: jiazhipeng03/Duel-Engine
	DNode* DNode::removeChild( const DString& name )
	{
		DNode* ret;
		ChildSet::iterator	i, iend = mChildren.end();
		for (i = mChildren.begin();i != iend; ++i)
		{
			if ((*i)->mName == name)
			{
				break;
			}
		}
		if (i != mChildren.end())
		{
			ret = *i;
			cancelUpdate(ret);
			(ret)->mParent = NULL;
			signalDetached(this, ret);
			mChildren.erase(i);
			return ret;
		}
		return NULL;
	}
コード例 #6
0
    //-----------------------------------------------------------------------
    Node* Node::removeChild(unsigned short index)
    {
        Node* ret;
        if (index < mChildren.size())
        {
            ChildNodeMap::iterator i = mChildren.begin();
            while (index--) ++i;
            ret = i->second;
            // cancel any pending update
            cancelUpdate(ret);

            mChildren.erase(i);
            ret->setParent(NULL);
            return ret;
        }
        else
        {
            OGRE_EXCEPT(
                Exception::ERR_INVALIDPARAMS,
                "Child index out of bounds.",
                "Node::getChild" );
        }
        return 0;
    }
コード例 #7
0
void QDeclarativeLandmarkCategoryModel::startUpdate()
{
#ifdef QDECLARATIVE_LANDMARK_DEBUG
    qDebug("QDeclarativeLandmarkCategoryModel::startUpdate()");
#endif
    if (!m_manager) {
        m_updatePending = false;
        return;
    }
    // Clear any previous updates and request new
    cancelUpdate();
    if (m_landmark) {
        QLandmarkCategoryFetchByIdRequest* req = new QLandmarkCategoryFetchByIdRequest(m_manager, this);
        req->setCategoryIds(m_landmark->categoryIds());
        m_fetchRequest = req;
    } else {
        m_fetchRequest = new QLandmarkCategoryFetchRequest(m_manager, this);
        setFetchRange();
        setFetchOrder();
    }
    QObject::connect(m_fetchRequest, SIGNAL(stateChanged(QLandmarkAbstractRequest::State)), this, SLOT(fetchRequestStateChanged(QLandmarkAbstractRequest::State)));
    m_fetchRequest->start();
    m_updatePending = false; // Allow requesting updates again
}
コード例 #8
0
void
UpdateProgressDialog::onCancel()
{
  emit cancelUpdate();
  hide();
}