MCPcopy Create free account
hub / github.com/baldurk/renderdoc / show

Method show

qrenderdoc/Code/QRDUtils.cpp:2416–2447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2414 QMessageBox::StandardButtons(QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
2415
2416void RDDialog::show(QMenu *menu, QPoint pos)
2417{
2418 // menus aren't always visible immediately, so we need to listen for aboutToHide to exit the event
2419 // loop. As a safety precaution because I don't trust the damn signals, if we loop for over a
2420 // second then we'll quit as soon as the menu is not visible
2421 volatile bool menuHiding = false;
2422 auto connection =
2423 QObject::connect(menu, &QMenu::aboutToHide, [&menuHiding]() { menuHiding = true; });
2424
2425 menu->setWindowModality(Qt::ApplicationModal);
2426 menu->popup(pos);
2427
2428 QElapsedTimer elapsed;
2429 elapsed.start();
2430
2431 QEventLoop loop;
2432 for(;;)
2433 {
2434 // stop processing once aboutToHide has been signalled
2435 if(menuHiding)
2436 break;
2437
2438 // stop processing if 1s has passed and the menu isn't visible anymore.
2439 if(elapsed.hasExpired(1000) && !menu->isVisible())
2440 break;
2441
2442 loop.processEvents(QEventLoop::WaitForMoreEvents);
2443 QCoreApplication::sendPostedEvents();
2444 }
2445
2446 QObject::disconnect(connection);
2447}
2448
2449int RDDialog::show(QDialog *dialog)
2450{

Callers 8

handleSoftwareInputPanelFunction · 0.45
moveToolWindowsMethod · 0.45
foreachFunction · 0.45
updateDragPositionMethod · 0.45
BringToForegroundFunction · 0.45
BeginMethod · 0.45
jquery-3.6.0.jsFile · 0.45
jquery.jsFile · 0.45

Calls 5

connectFunction · 0.85
disconnectFunction · 0.85
startMethod · 0.45
isVisibleMethod · 0.45
resultMethod · 0.45

Tested by

no test coverage detected