Q_OBJECT macro should be in your class definition and your function should be declared in "slots" section. In this case you'll be able to do "your connect".