On Thursday 20 February 2014 17:13:13 Thomas Lübking 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

Attachment: signature.asc
Description: This is a digitally signed message part.

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to