[PyQt] pyqt5.1 QWidget.childAt() exception
Stephen Gava
elguavas at gmail.com
Mon Oct 7 03:19:08 BST 2013
i've noted possible temporary workarounds for this issue in the related
thread titled:
Re: [PyQt] pyqt5.1 baffling exceptions: AttributeError: 'Qxxxxxx' object
has no attribute 'QWidget'
stephen.
On 05/10/13 19:31, Phil Thompson wrote:
> On Fri, 04 Oct 2013 16:07:38 +1000, Stephen Gava <elguavas at gmail.com>
> wrote:
>> i've found another puzzling (to me) difference in behaviour between
>> pyqt5 and pyqt4.
>>
>> using pyqt4 this works without any problem:
>>
>>
> child_widget=self.parent_widget.childAt(self.parent_widget.mapFromGlobal(QCursor.pos()))
>>
>> returning the child widget under the cursor, which i can then use in
>> subsequent operations, whether the toplevel parent window is active or
> not.
>>
>> using pyqt5 (pyqt 5.1 with qt 5.1 on linux x64) it works if the toplevel
>
>> parent window is active, however if the toplevel parent window is
>> inactive, trying to use the returned reference child_widget in any way
>> throws a confusing (to me) exception, which, in the case of the widgets
>> i'm using is:
>>
>> AttributeError: 'QLabel' object has no attribute 'QWidget'
>>
>> can anyone shed any light on this?
>
> Do you have a small, complete test case that demonstrates the problem?
>
> Phil
>
More information about the PyQt
mailing list