<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 5, 2015 at 3:26 PM, Andreas Pakulat <span dir="ltr"><<a href="mailto:apaku@gmx.de" target="_blank">apaku@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I'm a bit at a loss what to do following a call to such a method. What is the best way to "idle" until the callback comes? n.b. I don't see any WebEngine specific guidance at the PyQt5 doc [2].</div></div></blockquote><div><br></div></span><div>I'd say just as all other callbacks in Qt (i.e. signal/slots), return control to the qt event loop.</div></div></div></div></blockquote><div><br></div><div>Could you clarify a bit? The doc [1] for QWebEnginePage.toPlainText() will at some unknown future time call my callback passing the text of the page. But I would make that call in some code that needs that text -- to write it to a file, say. So in a custom class based on QWebEngineView, I capture the ^S key, perhaps, for Save. I put a findSaveDialog and get a path string and open a text stream for output. Then...<br><br></div><div>    self.page().toPlainText( lambda s : self.save_plain_text = s )<br></div><div>    # Here --  twiddle my thumbs until I can...<br></div><div>    output_stream << self.save_plain_text<br><br></div>Is this the kind of thing you have in mind?<br><br></div><div class="gmail_quote">    self.save_plain_text = None<br></div><div class="gmail_quote">    self.page().toPlainText( lambda s : self.save_plain_text = s )<br></div><div class="gmail_quote">    while self.save_plain_text is None : QCoreApplication.processEvents()<br>    output_stream << self.save_plain_text<br><br><br></div></div></div>