[PyQt] UIC loader fails on Qt submodules classes
Phil Thompson
phil at riverbankcomputing.com
Fri Jan 5 16:15:51 GMT 2018
On 13 Dec 2017, at 4:44 pm, Giuseppe Corbelli <corbelligiuseppe at mesdan.it> wrote:
>
> Hi all
> I am using a QChartView in Qt Charts module and related designer plugin. The designer reports the item as QtCharts::QChartView, and apparently the namespace is used in other Qt modules too, so I'm assuming this is the right way to go.
>
> PyQt 5.9.2 cannot load such objects (and I expect other submodules objects too) because:
> 1) The widget-plugins/qtcharts.py takes care of QChartView while it should also manage QtCharts.QChartView
> 2) The _ModuleWrapper::search has a comment regarding the support for namespaces but it tries a getattr without catching AttributeError. In this case it would search QtCharts first (and fail), so the straightforward solution is to catch the exception and go on with the getattr cycle down the namespace list.
>
> I can submit a patch but it's really braindead stuff and I don't know if the AttributeError was not caught on purpose.
>
> Attached two simple files to demonstrate the problem.
Hopefully fixed in tonight's snapshot.
Thanks,
Phil
More information about the PyQt
mailing list