本文整理汇总了C++中QSimCommand::setClearAfterDelay方法的典型用法代码示例。如果您正苦于以下问题:C++ QSimCommand::setClearAfterDelay方法的具体用法?C++ QSimCommand::setClearAfterDelay怎么用?C++ QSimCommand::setClearAfterDelay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSimCommand
的用法示例。
在下文中一共展示了QSimCommand::setClearAfterDelay方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sportsMenu
void DemoSimApplication::sportsMenu( const QSimTerminalResponse& resp )
{
QSimCommand cmd;
if ( resp.result() == QSimTerminalResponse::Success ) {
// Item selected.
switch ( resp.menuItem() ) {
case SportsMenu_Chess:
{
cmd.setType( QSimCommand::DisplayText );
cmd.setDestinationDevice( QSimCommand::Display );
cmd.setText( "Kasparov 3, Deep Blue 4" );
command( cmd, this, SLOT(sendSportsMenu()) );
}
break;
case SportsMenu_Painting:
{
cmd.setType( QSimCommand::DisplayText );
cmd.setDestinationDevice( QSimCommand::Display );
cmd.setText( "Little Johnny 4, Little Sally 6" );
command( cmd, this, SLOT(sendSportsMenu()) );
}
break;
case SportsMenu_Snakes:
{
cmd.setType( QSimCommand::DisplayText );
cmd.setDestinationDevice( QSimCommand::Display );
cmd.setText( "Little Johnny 0, Little Sally 2" );
cmd.setClearAfterDelay( true );
command( cmd, this, SLOT(sendSportsMenu()) );
}
break;
default: mainMenu(); break;
}
} else if ( resp.result() == QSimTerminalResponse::BackwardMove ) {
// Request to move backward.
mainMenu();
} else {
// Unknown response - just go back to the main menu.
mainMenu();
}
}
示例2: sendDisplayText
void DemoSimApplication::sendDisplayText()
{
// Display a text string and then go back to the main menu once the
// text is accepted by the user.
QSimCommand cmd;
cmd.setType( QSimCommand::DisplayText );
cmd.setDestinationDevice( QSimCommand::Display );
cmd.setClearAfterDelay(false);
cmd.setImmediateResponse(true);
cmd.setHighPriority(false);
immediateResponse = true;
cmd.setText( "Police today arrested a man on suspicion "
"of making phone calls while intoxicated. Witnesses claimed "
"that they heard the man exclaim \"I washent dwinkn!\" as "
"officers escorted him away." );
command( cmd, this, SLOT(displayTextResponse(QSimTerminalResponse)) );
}
示例3: sticksGameLoop
void DemoSimApplication::sticksGameLoop( const QSimTerminalResponse& resp )
{
QSimCommand cmd;
if ( resp.result() == QSimTerminalResponse::Success ) {
// User has selected the number of sticks they want.
int taken = 0;
if ( resp.text() == "1" ) {
taken = 1;
} else if ( resp.text() == "2" ) {
taken = 2;
} else if ( resp.text() == "3" ) {
taken = 3;
} else {
cmd.setType( QSimCommand::GetInkey );
cmd.setText( "Must be 1, 2, or 3. There are " + QString::number( sticksLeft ) +
" sticks left. How many sticks do you take?" );
cmd.setWantDigits( true );
command( cmd, this, SLOT(sticksGameLoop(QSimTerminalResponse)) );
return;
}
cmd.setType( QSimCommand::DisplayText );
cmd.setDestinationDevice( QSimCommand::Display );
cmd.setText( "I take " + QString::number( 4 - taken ) + " sticks." );
cmd.setClearAfterDelay( true );
sticksLeft -= 4;
command( cmd, this, SLOT(sticksGameShow()) );
} else if ( resp.result() == QSimTerminalResponse::HelpInformationRequested ) {
// Display help for the game.
cmd.setType( QSimCommand::DisplayText );
cmd.setDestinationDevice( QSimCommand::Display );
cmd.setText( "Starting with 21 sticks, players pick up 1, 2, or 3 sticks at a time. "
"The loser is the player who has to pick up the last stick." );
command( cmd, this, SLOT(startSticksGame()) );
} else {
// Probably aborted.
mainMenu();
}
}