Hi
I have 100 Check-boxes (objects of QCheckBox) and 100 Line-edits (objects of QLineEdit) like this:

Qt Code:
  1. QCheckBox chb[100];
  2. QLineEdit lndt[100];
To copy to clipboard, switch view to plain text mode 

now I want to connect chb[0] to lndt[0] and chb[1] to lndt[1] and chb[2] to lndt[2] ,... and chb[99] to lndt[99]

One way is to write 100 times connects like:
Qt Code:
  1. QObject::connect(chb, SIGNAL(textChanged(QString)), lndt, SLOT(setText(QString)));
  2. QObject::connect(chb+1, SIGNAL(textChanged(QString)), lndt+1, SLOT(setText(QString)));
  3. QObject::connect(chb+2, SIGNAL(textChanged(QString)), lndt+2, SLOT(setText(QString)));
  4. .
  5. .
  6. .
  7. QObject::connect(chb+99, SIGNAL(textChanged(QString)), lndt+99, SLOT(setText(QString)));
To copy to clipboard, switch view to plain text mode 


Is there any other idea for using a for loop to do this.
Thanks a lot for any help