PyQt6 and QWindowCapture

Jason Hallen hallenj at gmail.com
Fri Feb 23 20:04:34 GMT 2024


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 "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 "TESTING
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 PM Vincent Vande Vyvre <
vincent.vande.vyvre at 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 — anim - <PyQt6.QtMultimedia.QCapturableWindow object at
> > 0x1034f6ea0>
>
>
> Vincent
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20240223/052becea/attachment.htm>


More information about the PyQt mailing list