Hi

i have a problem... My class create QDialog with a button, i try to connect button from dialog with another function but it dosent work.

Qt Code:
  1. void klient::Mrejestracja()
  2. {
  3. QGridLayout *gridLayout;
  4. QPushButton *R_pb_w;
  5. QDialog *dialog = new QDialog();
  6.  
  7.  
  8. dialog->resize(249, 131);
  9. gridLayout = new QGridLayout(dialog);
  10. gridLayout->setSpacing(6);
  11. gridLayout->setMargin(11);
  12.  
  13. R_pb_w = new QPushButton(dialog);
  14. R_pb_w->setObjectName(QString::fromUtf8("R_pb_w"));
  15.  
  16. gridLayout->addWidget(R_pb_w, 2, 0, 1, 2);
  17.  
  18.  
  19.  
  20. dialog->setWindowTitle(QApplication::translate("dialog", "dialog", 0, QApplication::UnicodeUTF8));
  21. R_pb_w->setText(QApplication::translate("dialog", "Wy\305\233lij", 0, QApplication::UnicodeUTF8));
  22.  
  23. connect(R_pb_w,SIGNAL( clicked() ), this, SLOT(Trejestracja("a","b")));
  24. dialog->exec();
  25.  
  26.  
  27.  
  28. void klient::Trejestracja(QString l,QString h)
  29. {
  30. tcpSocket->write("R \n");
  31. tcpSocket->write("!"+l.toLatin1()+"!" + h.toLatin1() + "\n");
  32. }
To copy to clipboard, switch view to plain text mode 

When i connect it to another function it works... but with Trejestracja it dosent work...

Best Regards

Thx for help