Results 1 to 2 of 2

Thread: connect problem QDialog

  1. #1
    Join Date
    Dec 2007
    Posts
    28
    Thanks
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default connect problem QDialog

    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

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: connect problem QDialog

    You can't add parameter values like that in signals and slots. Use QSignalMapper or a custom slot.
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    Zergi (1st January 2008)

Similar Threads

  1. QDialog / QListView problem
    By harakiri in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2007, 18:31
  2. [QMYSQL] connection problem
    By chaos_theory in forum Installation and Deployment
    Replies: 5
    Last Post: 2nd July 2007, 09:52
  3. Resizing a QDialog to the content size
    By Nyphel in forum Qt Programming
    Replies: 8
    Last Post: 15th March 2007, 08:16
  4. Very simple problem with QServerSocket and Qsocket
    By eter in forum Qt Programming
    Replies: 2
    Last Post: 4th November 2006, 08:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.