python - PySide Signal with Argument -


qgroupbox has signal clicked has optional checked parameter. suppose i'm trying connect slot inside of class so: box.clicked.connect(self.func), declaration of slot must def func(self, checked), func being called 1 argument. how desired behaviour of func being called both self , optional checked arguments?

the behaviour of signals optional default parameters differs between pyqt , pyside. in pyqt, default parameter always sent, in pyside have explicitly request it:

    box.clicked[bool].connect(self.func) 

this better design choice, say, pyqt behaviour can lead bugs if forget default value sent though didn't ask it. case of explicit being better implicit...


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -