I have a QListWidget with few elements. Moving through the list is done with the arrow keys. How to make the "infinite loop", meaning that whan the last item is reached and you go down, the selection jumps to the first item, and reverse from first to last if you want to go up? Here is part of the code for creating list widget:
self.listWidget = QtGui.QListWidget(Form)
self.listWidget.setFont(font)
self.listWidget.setFocusPolicy(QtCore.Qt.StrongFocus)
self.listWidget.setAutoFillBackground(True)
self.listWidget.setAlternatingRowColors(True)
self.listWidget.setWordWrap(True)
self.listWidget.setSelectionRectVisible(True)
self.listWidget.setObjectName("listWidget")
self.listWidget.hasFocus()
self.listWidget.itemActivated.connect(self.klik)
self.gridLayout.addWidget(self.listWidget, 0, 0, 1, 1)