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

List:       pykde
Subject:    Re: [PyQt] Multiple Signals Emitted
From:       "Rapczak, Jesse" <jrapczak () soe ! sony ! com>
Date:       2012-01-27 23:24:08
Message-ID: 429AA9673D00424FADF9905B7CFFC31B07D0D149 () mail-sd6 ! ad ! soe ! sony ! com
[Download RAW message or body]

Nevermind, I was calling setupUi and then explicitly connecting the slots, so they were being \
connected twice.

Oops!

--
Jesse

-----Original Message-----
From: pyqt-bounces@riverbankcomputing.com [mailto:pyqt-bounces@riverbankcomputing.com] On \
                Behalf Of Rapczak, Jesse
Sent: Friday, January 27, 2012 5:05 PM
To: pyqt@riverbankcomputing.com
Subject: [PyQt] Multiple Signals Emitted

I've been loading Designer UI's using uic.loadUiType and noticed that my slots were getting \
called twice. After some digging I discovered the use of the pyqtSlot() decorator and the \
possibility that all signal types are being automatically connected to the same slot. From the \
PyQt4 docs:

	For example, QtGui.QAbstractButton has the following signal:

		void clicked(bool checked = false);

	Qt implements this as the following:

		void clicked();
		void clicked(bool checked);

	The pyqtSlot() decorator can be used to specify which of the signals should be connected to \
the slot.

Am I on the right track, here? I can't seem to get pyqtSlot() to behave in the simple example \
of a button:


	    self.testBtn.clicked.connect(self.testFunc)


    @QtCore.pyqtSlot(bool)
    def testFunc(self, b):
        # Do what I really want

    @QtCore.pyqtSlot()
    def testFunc(self):
        pass

In the above example, the bottom function gets called twice. 

Am I on the right track? Is this why my slots are getting called twice? Any help would be \
greatly appreciated!

--
Jesse Rapczak
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
_______________________________________________
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