But where do I find the glue code that connects the signal with the slot? In the .ui file there is nothing, all .h and .cpp files give no clue. There is only the function for itself and somehow it is connected (by magicg). Is there somewhere a file with the actual code or is there a hidden .xml (or whatever) file that is interpreted during runtime?

Nope, there is no such file. The glue you are looking for is in the _ui.h file that is generated at compile time from the .ui file.

Note that you are probably better of making the connections between signals and slots explicitly, rather than relying on the auto-connect feature. So, in your constructor, after the setupUi() call, you expliclity put
@
connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(close()));
@

No need for a slot like you wrote, as close() already is a slot that you can connect to directly.

@Andre: thank you! There must be still one place where the information is stored - even during compile time the compiler must know what to connect.
But you gave me the important info: do it yourself in code ;-)

@JKSH: that's true for connections that were made in the Slot/Connections view (F4) but not for those in the context menu, that made me so curious ;-)