connecting clicked signal to different slots depending on function executing

tausciam at gmail.com tausciam at gmail.com
Sun Sep 1 15:39:30 EDT 2013


I have one tablewidget I want to use for two different uses, audio and video. If cover art is displayed and the user clicks the cover art, it emits a cell clicked and gets the list of the songs. If video thumbnails are displayed, it emits a cell clicked and plays the video fullscreen.

So, I have the same signal going to two different slots. Is there any way to break that connection before I define it again? In other words, in the audio section I could have something like:

[break video signal/slot connection]
self.tableWidget.cellClicked.connect(self.audiocell_clicked)

and then for the video section:

[break audio signal/slot connection]
self.tableWidget.cellClicked.connect(self.videocell_clicked)



More information about the Python-list mailing list