Closed
Conversation
Member
|
I may be remembering wrong, but I'd have to dig into the library to figure out what we do elsewhere. |
Contributor
|
I am not getting the error though. In [21]: QtCore.PYQT_VERSION_STR
Out[21]: '5.12.3'
In [22]: MB = QtCore.Qt.MouseButton
In [23]: btns = MB.LeftButton | MB.RightButton
In [24]: btns & MB.LeftButton
Out[24]: <PyQt5.QtCore.Qt.MouseButtons at 0x204a452c820>
In [25]: MB.LeftButton & btns
<ipython-input-25-27340288dfca>:1: DeprecationWarning: an integer is required (got type MouseButtons). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
MB.LeftButton & btns
Out[25]: <PyQt5.QtCore.Qt.MouseButtons at 0x204a4495580>
In [26]: bool(btns & MB.LeftButton)
Out[26]: True
In [27]: bool(btns & MB.MiddleButton)
Out[27]: False |
Member
Author
|
Closing in favor of #2250 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In my most recent environment (PyQt5 5.12.3 Qt 5.12.9), I started seeing errors in comparisons between MouseButton and MouseButtons (we used to be able to use
&to determine whether a MouseButton was included in a MouseButtons, but now this generatesTypeError: unsupported operand type(s) for &: 'MouseButton' and 'MouseButtons').This PR fixes a few instances of this comparison, plus a similar comparison between KeyboardModifier and KeyboardModifiers.
Also snuck in a fix for the HDF5 exporter; seems like importlib.util is no longer imported by default.