Hi
I have 100 Check-boxes (objects of QCheckBox) and 100 Line-edits (objects of QLineEdit) like this:
QCheckBox chb[100];
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:
.
.
.
QObject::connect(chb, SIGNAL(textChanged(QString)), lndt, SLOT(setText(QString)));
QObject::connect(chb+1, SIGNAL(textChanged(QString)), lndt+1, SLOT(setText(QString)));
QObject::connect(chb+2, SIGNAL(textChanged(QString)), lndt+2, SLOT(setText(QString)));
.
.
.
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
Bookmarks