[PyQt] TypeError: setLayoutDirection(self, Qt.LayoutDirection): argument 1 has unexpected type 'ProxyMetaclass'
sda at fstab.net
Sun Aug 4 18:45:10 BST 2019
On 2019-08-04 13:14, Phil Thompson wrote:
> On 04/08/2019 03:04, Kyle Altendorf wrote:
>> While reworking my code to correct the errors related to my previous
>> message I ran into another exception loading .ui files. This one
>> doesn't seem to be related to 3.7.4 specifically and I ran my test all
>> the way back to pyqt5.8 with the latest micro for each minor version
>> Code and output at:
>> The traceback ends up at:
>> line 417, in setProperties
>> getattr(widget, 'set%s%s' % (ascii_upper(prop_name),
>> TypeError: setLayoutDirection(self, Qt.LayoutDirection): argument
>> 1 has unexpected type 'ProxyMetaclass'
> Putting everything in the one script is probably causing problems, ie.
> the script that loads the UI also defines the custom widget which
> means the script is run twice (and maybe it would recurse if there was
> no exception).
This started with an error in my real many-file application. I first
recreated it in multiple files for the example then compacted down to
one. There was recursion because I forgot to add in `if __name__...` so
I did. Here is a copy of the example split back into two files.
More information about the PyQt