-
Notifications
You must be signed in to change notification settings - Fork 46
qtpy exception (setResizeMode is only available in Qt4) #401
Comments
Same error on TaurusValuesTable Traceback (most recent call last): |
This is strange... Taurus should be only using PyQt4 for now... I wonder if there is something unusual in your installation? That said, it is interesting to note these kind of warnings since we are eventually going to have to deal with them. |
Note:" the same exception can be triggered on a debian9 by e.g.,
... but it does not happen if using (so I assume that qtpy is being loaded when using taurusform) Also note that the suggestion to use |
Can anybody help in reproducing the problem (of loading qtpy) with an small snippet? |
Here is a smaller snippet for reproducing the exception. from taurus.external.qt import Qt
from taurus.qt.qtgui.application import TaurusApplication
app = TaurusApplication()
# Commenting this import makes the exception disappear
from taurus.qt.qtgui.editor import TaurusBaseEditor
Qt.QHeaderView(Qt.Qt.Vertical).setResizeMode(Qt.QHeaderView.Fixed) Running it one gets:
|
It looks like this is a bug introduced by qtpy. |
I created an issue in qtpy: |
As a workaround in the meanwhile we could do the ugly thing of trying Or, alternatively, we could do an early import of qtpy in taurus.qt to make sure that the intrusive patching is done (note that this is just pushing the same problem towards taurus users, whose code could be broken) |
Force an early import of qtpy and use pyqt5 API for QHeaderView in order to work around bug taurus-org#401 See also spyder-ide/qtpy#119 Fixes taurus-org#401
I finally opted for the "early import" workaround. See #473 |
(Fix #401) Work-around bug introduced by qtpy
It seems that a deprecated Qt4 method is called:
File "/home/sicilia/src/taurus/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py", line 186, in updateStyle
QtGui.QHeaderView.ResizeToContents) # .Stretch)
File "/usr/lib/python2.7/dist-packages/qtpy/_patch/qheaderview.py", line 83, in setResizeMode
raise Exception('setResizeMode is only available in Qt4. Use '
Exception: setResizeMode is only available in Qt4. Use setSectionResizeMode instead.
The text was updated successfully, but these errors were encountered: