C'mon. It's one function with 4 parameters. It doesn't need a book. It's what you learn on the first Qt lesson. We've been over this countless times for almost 4 years now. Maybe create an empty project and just add a button and practice just connects? It really shouldn't be that hard for you after all that time. I really don't want to sound like an a-hole, but it's really getting annoying to see dozen of people have to repeat the same things over and over and over and over and over and... you get the point.
@AnneRanch said:
I just spent a time to find out, the obvious, that "connect" needs to be in code before "emit"
Well... that's... I don't want to use word "obvious", but if you don't connect anything how is Qt supposed to know what you want to be called when you emit? It's like declaring a variable before you can use it. Yes, the thing needs to exist first before it can be used. Same with connection. It has to exist to be triggered. Function has to be declared before it is called. Class has to be declared before it is instantiated. Pretty much everything in C++ works this way.
So the "connect" AKA callback FUNCTION
It's not a callback function. It's a function that registers a callback (slot) with a signal. When an object emits a signal a slot of another object is called. That's all there is to it. It's very basic. The documentation is more than exhaustive. If you want the low level detail (you don't need them to use it) there's this article.
uses SIGNAL / SLOT declared as functions as a macro parameter
No. SIGNAL and SLOT are macros that turn whatever you pass them into strings, e.g. if you type SLOT(foo()) it will turn it into string "foo()". These strings are used as keys to look up function pointers. That's one of the reasons we've been trying to convince you for years to start using the pointer syntax. It's easier to understand, faster, safer... ah, I won't repeat myself. You know it already. We've repeated it countless times.