Quote Originally Posted by MrDeath View Post
there are several solutions

but all of them require that you have access to pointers of both classes(button and mainwindow),

you if you are working in button class
Qt Code:
  1. //suppose your main window is two level above parent
  2. connect(this,SIGNAL(clicked()),this->parent()->parent(),SLOT(slot()));
To copy to clipboard, switch view to plain text mode 

if your are woking in mainwindow class... then somehow get the pointer to button(usually button is directly a memeber of your mainwindow class)
Qt Code:
  1. connect(getButton(), SIGNAL(clicked()),this,SLOT(slot()));
To copy to clipboard, switch view to plain text mode 
Thanks, Mr. Death!