def __cloneMouseWheelEvent(self, e: QWheelEvent):
     pos = e.pos()
     globalPos = e.globalPos()
     pixelDelta = e.pixelDelta()
     angleDelta = e.angleDelta()
     buttons = e.buttons()
     modifiers = e.modifiers()
     phase = e.phase()
     inverted = e.inverted()
     clone = QWheelEvent(pos, globalPos, pixelDelta, angleDelta, buttons,
                         modifiers, phase, inverted)
     clone.ignore()
     clone.accepted = False
     return clone
Example #2
0
    def wheelEvent(self, event: QtGui.QWheelEvent):
        file_list = self.window.file_list
        if len(file_list.selectedItems()):
            index = file_list.row(file_list.selectedItems()[0])
        else:
            index = -1
        if event.pixelDelta().y() > 0:
            index -= 1
        else:
            index += 1

        if index >= file_list.count() or index == -2:
            index = file_list.count() - 1
        elif index < 0:
            index = 0

        file_list.setCurrentItem(file_list.item(index))