I've changed string - different for each button:

Qt Code:
  1. for (int j=0; j<4; j++)
  2. {
  3. button[j] = new QPushButton;
  4. connect(button[j], SIGNAL(clicked()), signalMapper, SLOT(map()));
  5. signalMapper->setMapping(button[j], QString::number(j));
  6. connect(signalMapper, SIGNAL(mapped(QString)), this, SLOT(myFun(QString)));
  7. }
To copy to clipboard, switch view to plain text mode 

And if I click on firs button function is triggered 4 times with '0', on second - four times with '1'. Why?

---------------------------------------------------OK, again solved

Qt Code:
  1. connect(signalMapper, SIGNAL(mapped(QString)), this, SLOT(myFun(QString)));
To copy to clipboard, switch view to plain text mode 

should be once.

thanks
best regards
Tomasz