本文整理汇总了C++中Chess::show方法的典型用法代码示例。如果您正苦于以下问题:C++ Chess::show方法的具体用法?C++ Chess::show怎么用?C++ Chess::show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chess
的用法示例。
在下文中一共展示了Chess::show方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Chess w;
w.show();
return a.exec();
}
示例2: okPushButtonClicked
void ChessSelectionWidget::okPushButtonClicked()
{
if(isOK())
{
ChessType type = AIType;
QString stype(tr("ai"));
if(serverRadioButton->isChecked())
{
type = ServerType;
stype = tr("server");
}
else if(clientRadioButton->isChecked())
{
type = ClientType;
stype = tr("client");
}
else if(replayRadioButton->isChecked())
{
type = ReplayType;
stype = tr("replay");
}
ChessColor color = RedColor;
QString scolor("red");
if(ClientType == type)
{
color = BlackColor;
scolor = tr("black");
}
Chess_Info(tr("your selection: type=%1 color=%2 ip=%3 port=%4")
.arg(stype)
.arg(scolor)
.arg(ipLineEdit->text())
.arg(portSpinBox->value()));
ChessInformation *ci = ChessInformation::instance();
ci->init(type, color, ipLineEdit->text(), portSpinBox->value());
Chess *chess = Chess::instance();
chess->setAttribute(Qt::WA_DeleteOnClose); //窗口关闭时自动删除
this->hide();
chess->show();
}
else
{
Chess_Warning(tr("error input, please check!"));
QMessageBox::warning(this, tr("ERROR INPUT"), tr("ERROR INPUT, PLEASE CHECK!"));
}
}