Important: Please read the Qt Code of Conduct -

Pyqt QToolbox click event

  • I have a Qtoolbox and everytime I click one of the toolbox Items I would like to run a function (self.slotClicked).
    In the documentation there is an event called "currentChanged" which works fine but It only executes one time when opening an Item slot. How can I dispatch an event everytime the Item button is clicked. I am a beginner so please try to keep it simple.

    Thanks, my code so far below

    self.toolbox = QToolBox()
    self.toolbox.addItem(QLineEdit(), "Bla1")
    self.toolbox.addItem(QLineEdit(), "Bla2")
    self.connect(self.toolbox, SIGNAL('currentChanged(int)'), self.slotClicked)

Log in to reply