QWidget.findChildren() for QComboBox with QT5 compatibility layer in 2.1.50

when instantiating a QComboBox, with the QT5 compatibility layer enabled, we’re actually instantiating this class:
then later when doing
widget.findChildren(aqt.qt.QComboBox), the widget can’t be found. This code in AwesomeTTS worked with 2.1.49 and works with DISABLE_QT5_COMPAT=1. I just can’t figure out how to make it work with the QT5 compatibility layer enabled (and i’m guessing early versions of 2.1.50 will have it enabled).

I see two potential approaches but i’m stuck on both of these:
Can I instantiate a true, unaltered PyQt6.QtWidgets.QComboBox which is not wrapped by QtClassProxy ? If so, how ?

Or alternatively, what kind of type can I pass to widget.findChildren so that it locates the QComboBox wrapped in the QtClassProxy ?

I’m not sure why you’re using findChildren in the first place - wouldn’t it be easier to save the widget reference as an instance var when you create it, so you don’t need to go searching for it again later?

The original class is probably available with something like QComboBox.__bases__[0], though you’d need to make sure you handle the case where the wrappers aren’t active as well.

Part of the reason is there’s some ultra legacy code in AwesomeTTS, keep in mind it’s a codebase which has been around for > 10 years and has lived through python 2 to 3 conversion :stuck_out_tongue:
Your suggestion to avoid findChildren alltogether makes sense, let me see whether I can make that change.