[PyQt] question about SIGNAL strings

Zoltan Szalai flc at freemail.hu
Tue Jul 6 14:19:11 BST 2010


i don't think it makes any difference.
the result is the same in my application with event loop.
actually i could reduce the code to the one below because those dunder 
inits do nothing and i've mispelled them anyway :)
anyone? not that is so important. i'm just curious.

class ObjectOne(QObject):
    aSignal = pyqtSignal()

    def connectNotify(self, signal):
        print signal
       
class ObjectTwo(QObject):

    def foo(self):
        pass

obj1 = ObjectOne()
obj2 = ObjectTwo()
obj1.aSignal.connect(obj2.foo)




Sathishkumar Duraisamy wrote:
> Hi
>
> You have to construct a QCoreApplication or QApplication and have to 
> start event loop. 
>
> On Tue, Jul 6, 2010 at 1:06 AM, Zoltan Szalai <flc at freemail.hu 
> <mailto:flc at freemail.hu>> wrote:
>
>     hello,
>
>     running the attached code snippet the result is as follows:
>     2destroyed(QObject*)
>     2aSignal()
>
>     i'd like to ask what are those '2'-s at the start of the strings for?
>     the result is the same if i'd just print out SIGNAL('aSignal()').
>     probably a stupid question but i'd like to understand how things work.
>
>     PyQt version: 4.7.3
>     Qt version: 4.6.2
>     Python version: 2.6.5
>
>     thx
>     Zoltan
>
>     _______________________________________________
>     PyQt mailing list    PyQt at riverbankcomputing.com
>     <mailto:PyQt at riverbankcomputing.com>
>     http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 9.0.830 / Virus Database: 271.1.1/2985 - Release Date: 07/06/10 08:36:00
>
>   


Sathishkumar Duraisamy wrote:
> Hi
>
> You have to construct a QCoreApplication or QApplication and have to 
> start event loop. 
>
> On Tue, Jul 6, 2010 at 1:06 AM, Zoltan Szalai <flc at freemail.hu 
> <mailto:flc at freemail.hu>> wrote:
>
>     hello,
>
>     running the attached code snippet the result is as follows:
>     2destroyed(QObject*)
>     2aSignal()
>
>     i'd like to ask what are those '2'-s at the start of the strings for?
>     the result is the same if i'd just print out SIGNAL('aSignal()').
>     probably a stupid question but i'd like to understand how things work.
>
>     PyQt version: 4.7.3
>     Qt version: 4.6.2
>     Python version: 2.6.5
>
>     thx
>     Zoltan
>
>     _______________________________________________
>     PyQt mailing list    PyQt at riverbankcomputing.com
>     <mailto:PyQt at riverbankcomputing.com>
>     http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 9.0.830 / Virus Database: 271.1.1/2985 - Release Date: 07/06/10 08:36:00
>
>   



More information about the PyQt mailing list