本文整理汇总了C++中QDialog::showFullScreen方法的典型用法代码示例。如果您正苦于以下问题:C++ QDialog::showFullScreen方法的具体用法?C++ QDialog::showFullScreen怎么用?C++ QDialog::showFullScreen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDialog
的用法示例。
在下文中一共展示了QDialog::showFullScreen方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: registerScore
void OptionsGamestate::registerScore(int score, int level) {
if( score <= 0 )
return;
if( mainWindow->getHiscores().size() >= max_hiscore_entries_c ) {
// check we get onto the board
Hiscore lastHiscore = mainWindow->getHiscores().at(max_hiscore_entries_c-1);
if( score < lastHiscore.getScore() ||
( score == lastHiscore.getScore() && level <= lastHiscore.getLevel() ) ) {
return;
}
}
//QWidget *enterHiscoreWindow = new QWidget(mainWindow);
QDialog *enterHiscoreWindow = new QDialog(mainWindow);
QVBoxLayout *layout = new QVBoxLayout();
enterHiscoreWindow->setLayout(layout);
QLineEdit *nameEdit = NULL;
{
QString text = "You scored " + QString::number(score) + "! Enter your name:";
QLabel *scoreLabel = new QLabel(text);
layout->addWidget(scoreLabel);
}
/*{
QLabel *label = new QLabel("Enter your name:");
layout->addWidget(label);
}*/
{
nameEdit = new QLineEdit("");
layout->addWidget(nameEdit);
/*QHBoxLayout *h_layout = new QHBoxLayout();
layout->addLayout(h_layout);
QLabel *nameLabel = new QLabel(tr("Enter Name:"));
h_layout->addWidget(nameLabel);
nameEdit = new QLineEdit("");
h_layout->addWidget(nameEdit);*/
}
layout->addStretch();
{
QPushButton *okayButton = new QPushButton("Okay");
layout->addWidget(okayButton);
connect(okayButton, SIGNAL(clicked()), enterHiscoreWindow, SLOT(accept()));
}
enterHiscoreWindow->showFullScreen();
enterHiscoreWindow->exec();
QString name = nameEdit->text();
qDebug("Entered name: %s", name.toStdString().c_str());
Hiscore hiscore(name, score, level);
this->mainWindow->addHiscore(hiscore);
delete enterHiscoreWindow;
}