From pykde Mon Jan 05 23:26:08 2015 From: Andreas Pakulat Date: Mon, 05 Jan 2015 23:26:08 +0000 To: pykde Subject: Re: [PyQt] QWebEnginePage API for callbacks Message-Id: X-MARC-Message: https://marc.info/?l=pykde&m=142050045517187 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============3441436668807856019==" --===============3441436668807856019== Content-Type: multipart/alternative; boundary=001a113b51a4d9eb21050bf0034a --001a113b51a4d9eb21050bf0034a Content-Type: text/plain; charset=UTF-8 Hi David, On Mon, Jan 5, 2015 at 11:06 PM, David Cortesi wrote: > In Qt5.4, the new QWebEngine interface takes account of the fact that the > underlying Chromium engine is asynchronous. Four of the methods of > QWebEnginePage take an argument "FunctorOrLambda" as a callback to receive > control when the result is ready (for example, [1]). > > Using PyQt, I assume we can pass a Python defined function or lambda in > this position? > > 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]. > I'd say just as all other callbacks in Qt (i.e. signal/slots), return control to the qt event loop. Andreas --001a113b51a4d9eb21050bf0034a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi David,

On Mon, Jan 5, 2015 at 11:06 PM, David Cortesi &= lt;davecortesi@g= mail.com> wrote:
In Qt5.4, the new QWebEngine interface takes account of = the fact that the underlying Chromium engine is asynchronous. Four of the m= ethods of QWebEnginePage take an argument "FunctorOrLambda" as a = callback to receive control when the result is ready (for example, [1]).
Using PyQt, I assume we can pass a Python defined function or la= mbda in this position?

I'm a bit at a loss what to do foll= owing a call to such a method. What is the best way to "idle" unt= il the callback comes? n.b. I don't see any WebEngine specific guidance= at the PyQt5 doc [2].

I'd say ju= st as all other callbacks in Qt (i.e. signal/slots), return control to the = qt event loop.

Andreas=C2=A0
--001a113b51a4d9eb21050bf0034a-- --===============3441436668807856019== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KUHlRdCBtYWls aW5nIGxpc3QgICAgUHlRdEByaXZlcmJhbmtjb21wdXRpbmcuY29tCmh0dHA6Ly93d3cucml2ZXJi YW5rY29tcHV0aW5nLmNvbS9tYWlsbWFuL2xpc3RpbmZvL3B5cXQ= --===============3441436668807856019==--