[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] auto-connected slots (QAction.triggered) seem to be connected twice
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2014-10-24 14:50:04
Message-ID: 3567a6db179c6e94c66ace74801df5b7 () riverbankcomputing ! com
[Download RAW message or body]

On 23/10/2014 6:11 pm, Alan Ezust wrote:
> I just tried creating a QMainWindow app with Designer integration and I
> wanted to
> use an auto-connected slot. I am attaching the code here.
> The signal is emitted only once, I can see but the auto-connected slot 
> is
> called twice for each trigger of the action.
> 
> I reproduced this in PtQt 5.2.1 as well as PyQt 3.4.2 on windows 7.

Qt implements signals with an optional argument as two signals. Decorate 
the method to tell PyQt which you want. As you are not using the 
extraObj then...

     @pyqtSlot()
     def on_actionOpen_triggered(self):

Phil

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic