2009年5月12日 星期二

Qt的signal and slot mechanism

connect(sender, SIGNAL(signal), receiver, SLOT(slot));

Sender and receiver are pointers to "QObject"s and where signal and slot are function signatures without parameter names. The SIGNAL() and SLOT() macros essentially convert their argument to a string.

One signal can be connected to many slots. Many signals can be connected to the same slot. A signal can be connected to another signal.