本文整理汇总了C++中popState函数的典型用法代码示例。如果您正苦于以下问题:C++ popState函数的具体用法?C++ popState怎么用?C++ popState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了popState函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: popState
bool KHTMLReader::parse_ul(DOM::Element e)
{
_list_depth++;
bool popstateneeded = false;
for (DOM::Node items = e.firstChild();!items.isNull();items = items.nextSibling()) {
if (items.nodeName().string().toLower() == "li") {
if (popstateneeded) {
popState();
//popstateneeded = false;
}
pushNewState();
startNewLayout();
popstateneeded = true;
_writer->layoutAttribute(state()->paragraph, "COUNTER", "numberingtype", "1");
_writer->layoutAttribute(state()->paragraph, "COUNTER", "righttext", ".");
if (e.tagName().string().toLower() == "ol") {
_writer->layoutAttribute(state()->paragraph, "COUNTER", "type", "1");
_writer->layoutAttribute(state()->paragraph, "COUNTER", "numberingtype", "1");
_writer->layoutAttribute(state()->paragraph, "COUNTER", "righttext", ".");
} else {
_writer->layoutAttribute(state()->paragraph, "COUNTER", "type", "10");
_writer->layoutAttribute(state()->paragraph, "COUNTER", "numberingtype", "");
_writer->layoutAttribute(state()->paragraph, "COUNTER", "righttext", "");
}
_writer->layoutAttribute(state()->paragraph, "COUNTER", "depth", QString("%1").arg(_list_depth - 1));
}
parseNode(items);
}
if (popstateneeded)
popState();
_list_depth--;
return false;
}
示例2: if
void RTF::Reader::insertUnicodeSymbol(qint32 value)
{
m_cursor.insertText(QChar(value));
for (int i = m_state.skip; i > 0;) {
m_token.readNext();
if (m_token.type() == TextToken) {
int len = m_token.text().count();
if (len > i) {
m_cursor.insertText(m_codec->toUnicode(m_token.text().mid(i)));
break;
} else {
i -= len;
}
} else if (m_token.type() == ControlWordToken) {
--i;
} else if (m_token.type() == StartGroupToken) {
pushState();
break;
} else if (m_token.type() == EndGroupToken) {
popState();
break;
}
}
}
示例3: switch
void Game::executeStackChanges()
{
// Parameters expected in mStackAction and mStackParam.
switch (rStackAction) {
case SAID::POP:
{
popState();
break;
}
case SAID::PUSH:
{
pushState(rStackParam);
break;
}
case SAID::SWAP:
{
swapState(rStackParam);
break;
}
case SAID::RETURN_TO:
{
returnToState(rStackParam);
break;
}
case SAID::CLEAR:
{
clearStateStack();
break;
}
default: break;
}
// Finally, reset stack action requests:
rStackAction = SAID::NOTHING;
}
示例4: popState
void StateManager::changeState(State *state) {
// pop the current state
popState();
// push the new state
pushState(state);
}
示例5: popState
void Game::changeState(GameState* state) {
if(!this->states.empty())
popState();
pushState(state);
return;
}
示例6: while
Game::~Game()
{
while (!states.empty())
{
popState();
}
}
示例7: popState
void App::changeState(AppState* state) {
if(!this->states.empty())
popState();
pushState(state);
return;
}
示例8: popStateOrRevert
void StateMachine::popStateOrRevert()
{
if(!popState())
{
pushState(previousState);
}
}
示例9: while
void CursorDropdown::onStateDeactivate(StateEvent* event)
{
if (!_deactivated)
{
auto game = Game::getInstance();
auto mouse = game->mouse();
// workaround to get rid of cursor disappearing issues
std::vector<unsigned int> icons;
while (mouse->states()->size() > _initialMouseStack)
{
icons.push_back(mouse->state());
mouse->popState();
}
if (icons.size() > 0)
{
icons.pop_back(); // remove empty icon from CursorDropdown state
// place only new icons back in stack
for (auto it = icons.rbegin(); it != icons.rend(); it++)
{
mouse->pushState(*it);
}
}
mouse->setX(_initialX);
mouse->setY(_initialY);
_deactivated = true;
}
}
示例10: while
GameManager::~GameManager()
{
while (!gameState.empty())
{
popState(); //Delete happens in pop.
}
}
示例11: state
void KHTMLReader::parseNode(DOM::Node node)
{
// check if this is a text node.
DOM::Text t = node;
if (!t.isNull()) {
_writer->addText(state()->paragraph, t.data().string(), 1, state()->in_pre_mode);
return; // no children anymore...
}
// is this really needed ? it can't do harm anyway.
state()->format = _writer->currentFormat(state()->paragraph, true);
state()->layout = _writer->currentLayout(state()->paragraph);
pushNewState();
DOM::Element e = node;
bool go_recursive = true;
if (!e.isNull()) {
// get the CSS information
parseStyle(e);
// get the tag information
go_recursive = parseTag(e);
}
if (go_recursive) {
for (DOM::Node q = node.firstChild(); !q.isNull(); q = q.nextSibling()) {
parseNode(q);
}
}
popState();
}
示例12: popState
void
NextLevelState::keyPressed
(const OIS::KeyEvent &e) {
// Tecla p --> Estado anterior.
if (e.key == OIS::KC_P or e.key == OIS::KC_ESCAPE) {
popState();
}
}
示例13: while
/*****************************************************************************************************************************************************************
* changeState() removes the top state, and completely replaces it
* param1 : a state to push to the end of the state stack
**************************************************************************************************************************************************************/
void StateHandler::changeState(const statePtr& state)
{
while( !mStates.empty( ) ) {
popState();
}
mStates.emplace( state );
}
示例14: popState
void GameManager::changeState(GameState* state)
{
if (!gameState.empty())
{
popState();
}
pushState(state);
}
示例15: popState
void Game::changeState(GameState* state)
{
if (!states.empty())
{
popState();
}
pushState(state);
}