This is mainly preparation for upcoming typewriter tests
- QApplication::activeModalWidget is the simplest way to lookup a modal QInputDialog. In consequence, Okular::Part *p is no longer required.
- QMetaObject::invokeMethod(button, "click", Qt::QueuedConnection) is required to avoid crashes, when CloseDialogHelper is used for QInputDialog from PickPointEngine::addTextNote.
The latter is probably a workaround for a hidden bug in Okulars PickPointEngine::addTextNote. Try this:
Fire up okular in KDABs gammaray, select inline note tool, and click into a page. Now 20..50 QInputDialogs pop up immediately, instead of 1.
That's basically the same as what we encountered in the test prior using invokeMethod.
Depends on D15205 (well, not really, but I think it's best to present this revision as part of patch series).