Originally Posted by
ReDKiiL
Another help, connect has be placed always on the class of the signal?
You really need to do some reading before you have a chance at succeeding to write any code. Create a member variable in MainWindow for your Socket. I would add one of the following in the constructor of your MainWindow:
If you have added your member variable as a pointer to a Socket instance named pSocket for example, then use:
connect(pSocket, &Socket:updateButton, this, &MainWindow::onUpdateButton);
connect(pSocket, &Socket:updateButton, this, &MainWindow::onUpdateButton);
To copy to clipboard, switch view to plain text mode
If not a pointer but an actual instance named socket, then use:
connect(&socket, &Socket:updateButton, this, &MainWindow::onUpdateButton);
connect(&socket, &Socket:updateButton, this, &MainWindow::onUpdateButton);
To copy to clipboard, switch view to plain text mode
Originally Posted by
wysota
Class emits a signal?
When an instance of your other class wants to update the button text, emit a signal...
Touche
Edit: Not sure what I did to combine my reply to wysota with my other reply, but it's done and I'm not going to fix it up!
Bookmarks