使用python3.10,我尝试为PyQt5应用程序(例如Qt设计器)使用pywinauto和print_control_identifier。
from pywinauto.application import Application
import os
app = Application().start("C:/python/Lib/site-packages/QtDesigner/designer.exe")
main_dlg = app.QtDesigner
main_dlg.wait('visible')
main_dlg.print_control_identifiers()
输出:
Control Identifiers:
Qt5QWindowIcon - 'Qt Designer' (L632, T250, R1928, B1008)
['Qt Designer', 'Qt DesignerQt5QWindowIcon', 'Qt5QWindowIcon']
child_window(title="Qt Designer", class_name="Qt5QWindowIcon")
奇怪的是,控件标识符可能在child_window(title ="Qt Designer",class_name ="Qt5QWindowIcon")中,但我如何访问它们呢?
1条答案
按热度按时间5cg8jx4n1#
backend=“uia”修复问题。如果没有相关问题,请尝试backend=“win32”