in roboschool/cpp-household/python-binding.cpp [398:431]
bool test_window()
{
if (!app) app = app_create_as_needed(wref);
if (window) {
app->process_events();
if (window->isVisible()) {
if (ms_countdown==0) {
if (wref->cx->slowmo) {
window->setWindowTitle("SLOWMO");
} else {
window->setWindowTitle(
QString("%1 objects, %2ms bullet, %3ms render")
. arg(window->ms_render_objectcount)
. arg(wref->performance_bullet_ms, 0, 'f', 2)
. arg(window->ms_render, 0, 'f', 2) );
}
ms_countdown = 10;
} else {
ms_countdown -= 1;
}
return true;
}
return false; // Not visible (can't create again, app should quit)
}
window = new Viz(wref->cx);
window->key_callback = cb;
window->wheel /= SCALE;
QDesktopWidget* desk = QApplication::desktop();
qreal rat = desk->windowHandle()->devicePixelRatio();
window->resize(int(1280/rat), int(1024/rat));
window->show();
window->test_window_big_caption(big_caption);
return true;
}