I want to hide my application logic in a dll that only depends on QtCore. This dll will have the slots that will be called when the user does something in the GUI.

My questions is, what is best practice when it comes to the signals, should I define the signals in the dll as well? This seems strange since it is not the dll that emits them. On the other hand if I dont I need to provide a list of signals to anyone that would use the dll. Which is the way to go?


Say that I have a login button and when the user clicks it I want the onLogin(QString userName) slot in the dll to be called. For this I also need a signal, something like

void login(QString userName);

So when the user clicks the button the GUI code would be:

void on_btn_clicked()
emit login(this->getUserName()); //This sends the onLogin signal to the dll slot

The thing I do not know is where to define the login(QString userName) signal. Should it be in the dll interface or should I define it in the GUI based on what the slot looks like?