Hi,

I created a complex application with the qt creator (Below: I created a minimal example). Now I have a main window with some widgets (e.g. Form1) like buttons, which are always visible and I have some self-made widgets, which are promoted to a widget container. In one of this self-made widgets, there is a button (named pushButton1) which is related to a button (named: pushButton) on the main window. So I like to click one of the buttons and the clicked button and the other button appear enabled. The direction pushButton clicked and pushButton and pushButton1 are set enabled works. The other direction doesn't work. I don't get an error massage, if I click on pushButton1 itself appears enabled, but not the other pushbutton.
As you can see, I also tried it with signals and slots, but here I get the following error massage: "no matching function for call to 'MainWindow::connect(Form1 **, const char*, QPushButton**,const char*)'". Could anyone help me please?!

MainWindow
Qt Code:
  1. void MainWindow::on_pushButton_clicked()
  2. {
  3. ui->pushButton->setEnabled(false);
  4. QPushButton *button = this->findChild<QPushButton*>("pushButton1");
  5. button->setEnabled(false);
  6. //connect(&ui->widget, SLOT(setFocus()),&ui->pushButton,SIGNAL(setEnabled()));
  7. }
To copy to clipboard, switch view to plain text mode 
Form1
Qt Code:
  1. void Form1::on_pushButton1_clicked()
  2. {
  3. ui->pushButton1->setEnabled(false);
  4. MainWindow mainw;
  5. QPushButton *button = mainw.findChild<QPushButton*>("pushButton");
  6. button->setEnabled(false);
  7. //connect(&ui->pushButton1, SLOT(on_pushButton1_clicked()),&Form1 ,SIGNAL(setFocus()));
  8. }
To copy to clipboard, switch view to plain text mode 

I'm using Qt Creator 2.1.0 based on Qt 4.7.1