Results 1 to 7 of 7

Thread: question on connect

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jan 2006
    Posts
    976
    Qt products
    Qt3
    Platforms
    Windows
    Thanks
    53

    Default Re: question on connect

    Hello everybdy. I'm understand the real problem; this is my code
    Every time the openLightDialog() is called, it seems the connect below is duplicated: the SLOT starts many time how I called openLightDialog(); eg if I call openLightDialog() 3 times, when a signal occurs, activeTabLight(int) is called 3 time instead one; I tried to put a disconnect at the end (but I don't like it). Furthermore, it seems that disconnect conficlits with a connect inside myLightDialog() constructor....
    Qt Code:
    1. myLightDialog::myLightDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
    2. :lightDialog (parent, name, modal, fl) {
    3. connect (this->buttonGroupLL, SIGNAL(clicked(int)), this, SLOT(pushButtonLight(int))); // with disconnect at the end, this doesn't work!!
    4. }
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. void myMainForm::openLightDialog() {
    2. vector <QCheckBox*> cbl;
    3. cbl.push_back(lightd->checkBoxL0);
    4. ................................
    5. for (int i=0; i<8; i++)
    6. connect(cbl[i], SIGNAL(stateChanged(int)), this, SLOT(activeTabLight(int)));
    7. if(lightd->exec()){
    8. DoSomething();
    9. ......................
    10. }
    11. for (int i=0; i<8; i++) {
    12. cbl[i]->disconnect();
    13. }
    To copy to clipboard, switch view to plain text mode 
    How to do this? maybe Do I have to destroy that vector anywhere?
    thanks
    Last edited by mickey; 12th June 2006 at 16:30.
    Regards

Similar Threads

  1. many connect
    By mickey in forum Qt Programming
    Replies: 3
    Last Post: 29th May 2006, 12:55
  2. connect on a popup
    By mickey in forum Qt Programming
    Replies: 2
    Last Post: 12th April 2006, 16:37
  3. connect to sql server
    By raphaelf in forum Qt Programming
    Replies: 15
    Last Post: 27th February 2006, 18:06
  4. connect
    By mickey in forum Newbie
    Replies: 1
    Last Post: 25th February 2006, 18:31

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
  •  
Qt is a trademark of The Qt Company.