Change the Icon of the Selected Item of the QToolBox in PyQT

You can set a default icon when adding items, and then connect the currentChanged signal in order to set the other one.

If you create a basic list with both icons, setting the proper icon is even simpler, as you only need to cycle through all items and set the icon based on the index match.

class Test(QtWidgets.QWidget):
    def __init__(self):
        super().__init__()
        self.arrowIcons = []
        for direction in ('right', 'down'):
            self.arrowIcons.append(QtGui.QIcon(
                ':/icons/icons/arrow-{}.svg'.format(direction)))

        layout = QtWidgets.QVBoxLayout(self)
        self.toolBox = QtWidgets.QToolBox()
        layout.addWidget(self.toolBox)
        self.toolBox.currentChanged.connect(self.updateIcons)
        for i in range(5):
            self.toolBox.addItem(
                QtWidgets.QLabel(), 
                self.arrowIcons[0], 
                'Item {}'.format(i + 1))

    def updateIcons(self, index):
        for i in range(self.toolBox.count()):
            self.toolBox.setItemIcon(i, self.arrowIcons[index == i])