[PyQt] javascript does not execute method in exposed QT object

David Boddie davidb at met.no
Mon Mar 17 16:34:05 GMT 2014


On Mon Mar 17 12:12:37 GMT 2014, JC Francois wrote:
>
> JC Francois wrote:
>
> > Why doesn't checkBold get executed while the test() javascript function
> > runs?
>
> I found the solution myself. The trick is to add a @pyqtSlot() decoration in 
> front of the exposed method:
> 
>      @pyqtSlot()
>      def checkBold(self):
>          self.action_Bold.setChecked(True)

Thanks for posting an answer to your own question! I'm sure it will help others
in the future when they encounter the same problem.

David


More information about the PyQt mailing list