-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
AttributeError: 'QEvent' object has no attribute 'pos' #11607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Won't fix for v3.0? pyside/PySide#132 . http://doc.qt.io/archives/qt-4.8/qwidget.html#enterEvent |
It's clearly a (big) regression, so it should be fixed. |
Bug fix for 2.2.x yes but not for 3.0. Since you have qt4 can you see which position attribute is passed to the event? If there is none then that does not make sense at all. |
It's an object of class QEvent, which has no pos(). |
Qt4 is deprecated. Anyway Unless the event gives us position then a possible fix is to catch the error and pass None as coordinates. This will also be a bug where user complains why no positions are passed down. |
We still support Qt4 and there is about to be one more release of it. I agree with @anntzer , dropping Qt4 support for mpl3 is not an option. The simplest fix is to just catch the exception and do |
closes matplotlib#11607 The event object passed in from PyQt4 does not have a `pos` attribute. Be forgiving of this and fallback to None. This matches the fallback behavior in backend_bases if xy is not passed to `enter_notify_event`.
closes matplotlib#11607 The event object passed in from PyQt4 does not have a `pos` attribute. Be forgiving of this and fallback to None. This matches the fallback behavior in backend_bases if xy is not passed to `enter_notify_event`.
@anntzer btw is there a problem with leaveEvent aswell? |
No, leaveEvent() doesn't have xy info (perhaps it should?). |
Having a similar issue in version 3.5.0, using pyqt5. |
@noonchen this is a new issue after a major refactor of the code. You can see the filename has changed. Could you describe what you are trying? Please also attach a sample code. Eventually create a new bug report. |
@lkjell Sorry for the late reply. I try to reproduce this issue but I failed to find the correct trigger, it happens once out of ~20 attempts maybe. I am embedding the matplotlib canvas into the QTabWidget, and the canvas has |
@noonchen can you open a new issue? Is there any more of the traceback? If it is only happening occasionally I assume that this is some sort of race condition which are fun to trace down! We could just make that code even more forgiving, but it would be better if we could understand at least what the race is between. |
Since #9814, moving the mouse on a Qt4Agg window raises the exception
(Qt5 instead uses a QEnterEvent here, which does have a
pos()
).attn @lkjell
The text was updated successfully, but these errors were encountered: