【发布时间】:2016-11-05 21:14:41
【问题描述】:
我从 Qt4 升级到 Qt5(具体来说是 PyQt)并且 QWheelEvent 对我来说中断了 - 它返回空的 pixelDelta(),但相位为 2(默认)。我在 Win 7 上,所以关于阶段的警告不应该适用于我。当我运行这段代码时:
from PyQt5 import QtWidgets
class Q(QtWidgets.QLabel):
def wheelEvent(self, event):
print(event.pixelDelta())
app = QtWidgets.QApplication([])
w = Q()
w.show()
app.exec_()
滚动打印没有坐标的“PyQt5.QtCore.QPoint()”。我能做什么?
【问题讨论】:
标签: python events qt5 pyqt5 mousewheel