Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Pyqt QToolbox click event
Qt 6.11 is out! See what's new in the release blog

Pyqt QToolbox click event

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 3.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tobbyd
    wrote on last edited by
    #1

    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)

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved