Support Qt4

signals are public in Qt5 and protected in Qt4. Thus we need a friend
declaration for Qt4 to be able to emit signals from the private class.