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

List:       kde-devel
Subject:    Re: last KWin question from me for long time :-) [connect signals]
From:       Damian Ivanov <damianatorrpm () gmail ! com>
Date:       2014-02-20 16:44:56
Message-ID: CAPVS_cedWsf4sGdBQODcv2Od5dDUNA2PZZp4mRuLhJ0i09Yqnw () mail ! gmail ! com
[Download RAW message or body]

Superb. So if one of you is at openSUSE con in Dubrovnik he'll get the
six pack than. But you'll both get one from me sooner or later :-)

2014-02-20 17:41 GMT+01:00 Martin Graesslin <mgraesslin@kde.org>:
> On Thursday 20 February 2014 17:13:13 Thomas L=FCbking wrote:
>> On Donnerstag, 20. Februar 2014 15:43:35 CEST, Damian Ivanov wrote:
>> > I try in the creation phase of my class
>> > connect(KWindowSystem::self(), SIGNAL(windowAdded()), this, SLOT(test(=
)));
>> > and MyClass::test() should be called when a window is added
>>
>> There's no "windowAdded()" signal - you have to use
>>
>>    connect(KWindowSystem::self(), SIGNAL(windowAdded(WId)), this,
>> SLOT(test()));
>>
>> whether your slot can make use of the parameter or not.
>> (QObject should btw. warn you about this on stderr or stdout)
>
> and even better: use the compile time checked connect variant:
>
> QObject::connect(KWindowSystem::self(), &KWindowSystem::windowAdded, this,
> &MyAwesomeClass::test);
>
> it will yell in the compiler if it doesn't match and you do not even have=
 to
> specify your slot as a Q_SLOT or you could pass in a lambda, etc. etc. :-)
>
> Cheers
> Martin
>
>>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscri=
be <<
>

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscrib=
e <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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