From pykde Mon Feb 26 04:10:28 2024 From: Maurizio Berti Date: Mon, 26 Feb 2024 04:10:28 +0000 To: pykde Subject: Re: PyQt6 and QWindowCapture Message-Id: X-MARC-Message: https://marc.info/?l=pykde&m=170892055419454 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--0000000000009234a90612411868" --0000000000009234a90612411868 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Instead of relying on arbitrary delays, you may consider installing an event filter on the target window and wait for QEvent.Type.Show, which should be safe enough. Once that's received the first time, you can remove the event filter and start querying the capturable windows. Regards, MaurizioB Il giorno ven 23 feb 2024 alle ore 21:11 Jason Hallen ha scritto: > Thanks for the suggestion, Vincent. I was able to figure out the problem. > My code was calling the QWindowCapture.capturableWindows() list before th= e > main PyQt window was fully shown. That's why "TESTING TESTING" wasn't on > the list. The solution was to call QWindowCapture.capturableWindows() at = a > later point (within a second even) once the window was shown. Then "TESTI= NG > TESTING" appears in the list and I can capture it. > > You're correct that "TESTING TESTING" is not an identifier, but the > .description() attribute of the QCapturableWindow (which is basically the > window title) is a convenient way of finding my window. > > Thanks, > Jason > > On Fri, Feb 23, 2024 at 12:02=E2=80=AFPM Vincent Vande Vyvre < > vincent.vande.vyvre@telenet.be> wrote: > >> On 22/02/24 23:50, Jason Hallen wrote: >> The window's title "Testing Testing" is not an identifier. >> I suspect the widget you're searching for is the: >> > 12 - anim.py =E2=80=94 anim - > > 0x1034f6ea0> >> >> >> Vincent >> >> >> --=20 =C3=88 difficile avere una convinzione precisa quando si parla delle ragion= i del cuore. - "Sostiene Pereira", Antonio Tabucchi http://www.jidesk.net --0000000000009234a90612411868 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Instead of relying on arbitrary delays, you may consi= der installing an event filter on the target window and wait for QEvent.Type.Show, which should be safe e= nough. Once that's received the first time, you can remove the event fi= lter and start querying the capturable windows.

Regards,<= /div>
MaurizioB

Il giorno ven 23 feb 2024 alle ore 21:11 Jaso= n Hallen <hallenj@gmail.com>= ha scritto:
Thanks for the suggestion, Vincent. I was able to figure= out the problem. My code was calling the QWindowCapture.capturableWindows(= ) list before the main PyQt window was fully shown. That's why "TE= STING TESTING" wasn't on the list. The solution was to call QWindo= wCapture.capturableWindows() at a later point (within a second even) once t= he window was shown. Then "TESTING TESTING" appears in the list a= nd I can capture it.

You're correct that "= ;TESTING TESTING" is not an identifier, but the .description() attribu= te of the QCapturableWindow (which is basically the window title) is a conv= enient way of finding my window.=C2=A0

Thanks,
Jason

On Fri, Feb 23, 2024 at 12:02=E2=80=AFPM V= incent Vande Vyvre <vincent.vande.vyvre@telenet.be> wrote:
On 22/02/24 23:50, Jason Hall= en wrote:
The window's title "Testing Testing" is not an identifier. I suspect the widget you're searching for is the:
> 12 - anim.py =E2=80=94 anim - <PyQt6.QtMultimedia.QCapturableWindow= object at
> 0x1034f6ea0>


Vincent




--
=C3=88 diffic= ile avere una convinzione precisa quando si parla delle ragioni del cuore. = - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net
--0000000000009234a90612411868--