Qt|批量清空控件内容

// 清空所有label
QList<QLineEdit *> lblhws = ui.centralWidget->findChildren<QLineEdit *>();
	foreach(QLineEdit *lbl, lblhws) {
		if (lbl != nullptr) {
			lbl->setText("");
			lbl->repaint();
			lbl->clearFocus();
		}
	}

你可能感兴趣的:(C/C++/qt,qt,开发语言)