How to call the added QWidget of QGridLayout.
Hi, ALL.
I 'm tired call the added QWidget of QGridLayout.
How I can call the added QWidget of QGridLayout?
follow the source.
qDebug() is print 0.
Code:
for (j=0; j<i; j++) {
grid->addWidget(label, j, 0);
grid->addWidget(ed, j, 1);
}
grid->addWidget(b, i, 0, 1, 2);
QList<QPushButton *> allPButtons = qFindChildren<QPushButton*> ( grid ); //grid->findChildren<QPushButton *>();
QList<QLabel *> allLabel = qFindChildren<QLabel*> ( grid ); // grid->findChildren<QLabel *>();
QList<QLineEdit *> allLine = qFindChildren<QLineEdit*> ( grid ); // grid->findChildren<QLineEdit *>();
qDebug() << "label count : " << allLabel.count();
qDebug() << "QLineEdit count : " << allLine.count();
for (j=0; j<allPButtons.count(); j++) {
delete allPButtons[j];
}
for (j=0; j<allLabel.count(); j++) {
delete allLabel[j];
}
for (j=0; j<allLine.count(); j++) {
delete allLine[j];
}