UIC loader fails on Qt submodules classes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

UIC loader fails on Qt submodules classes

Giuseppe Corbelli
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.
--
Giuseppe Corbelli

_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

ChartView.py (98 bytes) Download Attachment
ChartView.ui (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: UIC loader fails on Qt submodules classes

Phil Thompson-5
On 13 Dec 2017, at 4:44 pm, Giuseppe Corbelli <[hidden email]> 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

_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt