Closed chrisjbillington closed 2 years ago
My home dev system shows this same problem now. I haven't run a camera on it in some time and I tend to update packages willy-nilly. We are having a fair bit of snow, so Monday I can check a lab installation that hasn't been updated in quite some time and see what is going on.
For my future reference, my home install has python=3.8.11, qtutils=3.0.0, pyqt=5.9.2, and qt=5.9.7
Got it!
Older in lab system also showed this issue. Tested by running the following from the interpreter
>>>from qtutils.qt import QtGui
>>>QtGui.QSizePolicy
AttributeError: module 'PyQt5.QtGui' has no attribute 'QSizePolicy'
But I opened BLACS and lo and behold, the camera tab is working just fine!
Little bit of testing later, it appears PyQt5.QtGui.QSizePolicy
is being correctly redirected to QtWidgets by pyqtgraph
.
>>>from qtutils.qt import QtGui
>>>import pyqtgraph as pg
>>>QtGui.QSizePolicy
<class 'PyQt5.QtWidgets.QSizePolicy'>
Good find, that makes sense! Ptqtgraph would have been doing it for backward compatibility to aid their port to Qt 5.
The former doesn't exist in PyQt5 or PySide2, causing BLACS to fail to load
ImaqdxCamera
tabs.I do see google results for
QtGui.QSizePolicy
, so it existed at some point - perhaps in Qt4, and maybe provided inQtGui
since then as an alias for backwards compatibility, but the alias was removed at some point.I'm confused though because
ImaqdxCamera
is in common use and was written long after we moved away from PyQt4, but I don't seeQtGui.QSizePolicy
in PyQt5 5.9 or 5.15. 5.9 is pretty old, so ... how did this ever work? Wasqtutils
providing an alias? If so I don't see it doing so now.Whatever, as long as
QtWidgets.QSizePolicy
works for everyone, we should be good.If anyone wants to check if
QtGui.QSizePolicy
orQtWidgets.QSizePolicy
exist on their systems before I merge this, would be much appreciated.