Merge pull request #1559 from pijyoi/pyqt6_evbug
restrict PyQt6 QEvent.type() monkey patching to 6.0.0
This commit is contained in:
commit
ade6a844e7
@ -387,10 +387,7 @@ if QT_LIB == PYQT6:
|
|||||||
|
|
||||||
# PyQt6 6.0.0 has a bug where it can't handle certain Type values returned
|
# PyQt6 6.0.0 has a bug where it can't handle certain Type values returned
|
||||||
# by the Qt library.
|
# by the Qt library.
|
||||||
try:
|
if QtCore.PYQT_VERSION == 0x60000:
|
||||||
# 213 is a known failing value
|
|
||||||
QtCore.QEvent.Type(213)
|
|
||||||
except ValueError:
|
|
||||||
def new_method(self, old_method=QtCore.QEvent.type):
|
def new_method(self, old_method=QtCore.QEvent.type):
|
||||||
try:
|
try:
|
||||||
typ = old_method(self)
|
typ = old_method(self)
|
||||||
|
@ -113,12 +113,6 @@ class SpinBox(QtGui.QAbstractSpinBox):
|
|||||||
|
|
||||||
self.editingFinished.connect(self.editingFinishedEvent)
|
self.editingFinished.connect(self.editingFinishedEvent)
|
||||||
|
|
||||||
def event(self, ev):
|
|
||||||
ret = super().event(ev)
|
|
||||||
if ev.type() == QtCore.QEvent.KeyPress and ev.key() == QtCore.Qt.Key_Return:
|
|
||||||
ret = True ## For some reason, spinbox pretends to ignore return key press
|
|
||||||
return ret
|
|
||||||
|
|
||||||
def setOpts(self, **opts):
|
def setOpts(self, **opts):
|
||||||
"""Set options affecting the behavior of the SpinBox.
|
"""Set options affecting the behavior of the SpinBox.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user