本文整理汇总了C++中Problem::GetCompiler方法的典型用法代码示例。如果您正苦于以下问题:C++ Problem::GetCompiler方法的具体用法?C++ Problem::GetCompiler怎么用?C++ Problem::GetCompiler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Problem
的用法示例。
在下文中一共展示了Problem::GetCompiler方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onMenuTableEvent
void MainWindow::onMenuTableEvent(const QPoint& pos)
{
action_create_file->setEnabled(true);
action_create_dir->setEnabled(true);
action_open_dir->setEnabled(true);
action_open_dir->setText("打开目录(&O)...");
menu_table->clear();
QTableWidgetItem* item = board_table->itemAt(pos);
if (item)
{
int r = item->row(), c = item->column();
detail_table->onShowDetail(r, c);
r = Global::GetLogicalRow(r);
Player* player = Global::g_contest.players[r];
if (c > 1)
{
Problem* problem = Global::g_contest.problems[c - 2];
dirByAction = Global::g_contest.src_path + player->Name() + "/" + problem->Directory() + "/";
const Compiler* compiler = problem->GetCompiler(player->Name());
fileByAction = !compiler ? "" : compiler->SourceFile();
if (fileByAction.isEmpty())
{
playerByAction = player, problemByAction = problem;
if (problem->Type() == Global::AnswersOnly || !problem->CompilerCount())
action_create_file->setEnabled(false);
menu_table->addAction(action_create_file);
}
else
{
action_edit_file->setText(QString("编辑 \"%1\" (&E)...").arg(fileByAction));
menu_table->addAction(action_edit_file);
}
menu_table->addSeparator();
if (QDir(dirByAction).exists())
menu_table->addAction(action_open_dir);
else if (problem->Type() == Global::AnswersOnly || !problem->CompilerCount())
menu_table->addAction(action_create_dir);
else
{
action_open_dir->setEnabled(false);
menu_table->addAction(action_open_dir);
}
}
else
{
dirByAction = Global::g_contest.src_path + player->Name() + "/";
fileByAction = player->Name();
if (QDir(dirByAction).exists())
{
menu_table->addAction(action_open_dir);
menu_table->addSeparator();
action_remove_dir->setText(QString("删除选手 \"%1\" (&R)").arg(fileByAction));
menu_table->addAction(action_remove_dir);
}
else menu_table->addAction(action_create_dir);
}
}
else
{
menu_table->addAction(ui->action_refresh);
menu_table->addSeparator();
menu_table->addAction(ui->action_judge_selected);
menu_table->addAction(ui->action_judge_unjudged);
menu_table->addAction(ui->action_judge_all);
menu_table->addAction(ui->action_stop);
}
menu_table->popup(QCursor::pos());
}