[PyQt] slots don't get called

Phil Thompson phil at riverbankcomputing.com
Sat Sep 19 19:51:29 BST 2009


On Sat, 19 Sep 2009 19:35:29 +0200, Peter Bienstman
<Peter.Bienstman at ugent.be> wrote:
> Hi,
> 
> I have a rather strange problem with 4.5.4, in the sense that none of my 
> QAction slots get called under Windows. Under Linux with 4.4.4, the same 
> program runs fine...
> 
> Is there anything that could cause this?
> 
> My ui file has code like
> 
>   <connection>
>    <sender>actionAddCards</sender>
>    <signal>activated()</signal>
>    <receiver>MainWindow</receiver>
>    <slot>add_cards</slot>
>    <hints>
>     <hint type="sourcelabel">
>      <x>-1</x>
>      <y>-1</y>
>     </hint>
>     <hint type="destinationlabel">
>      <x>164</x>
>      <y>226</y>
>     </hint>
>    </hints>
>   </connection>
> 
> which gets translated into
> 
>         QtCore.QObject.connect(self.actionAddCards, 
> QtCore.SIGNAL("activated()"), MainWindow.add_cards)
> 
> I tried doing the connect code in my own code MainWindow, but that did
not 
> make a difference:
> 
>         self.connect(self.actionAddCards, QtCore.SIGNAL("activated()"), 
> self.add_cards)

Not a lot I can do without a test case that I can run...

Phil


More information about the PyQt mailing list