OxfordIonTrapGroup / wand

Wavemeter Analysis aNd Display
Apache License 2.0
13 stars 13 forks source link

breakage with recent PyQt5 #46

Closed hartytp closed 2 months ago

hartytp commented 3 years ago

We import our widgets from PyQt5.QtGui https://github.com/OxfordIonTrapGroup/wand/blob/39870368163b37f6680a8d6fd6867cbe47617fe7/wand/gui.py#L9 https://github.com/OxfordIonTrapGroup/wand/blob/39870368163b37f6680a8d6fd6867cbe47617fe7/wand/gui.py#L65

Running with the latest PyQtGraph we get errors like AttributeError: module 'PyQt5.QtGui' has no attribute 'QCheckBox'

Looking at the docs it seems like the path should be PyQt5.QWidgets.

I wonder if we can do something like

try:
    from PyQt5 import QtWidgets
except ImportError:
    from PyQt5 import QtGui
ljstephenson commented 1 year ago

This seems to work for everything except the right click context menus for me, in a freshly created environment. Are right-click context menus currently working? The only failure I have is with an attribute error with QCursor. Easy enough fix and can prepare a PR but I wonder if I'm the only person experiencing this and it's my environment somehow.

pyqtgraph - 0.12.3 pyqt - 5.15.7

hartytp commented 1 year ago

@ljstephenson thanks for the bug report. I can confirm that we get the same error - I just don't think any one has needed a right click for a long time so it never came up. A PR would be very welcome.

dnadlinger commented 2 months ago

This was fixed in https://github.com/OxfordIonTrapGroup/wand/commit/ee5dbf1f3105497891a39288fd2efa9e0b493b26.