rahulvishwakarma
24th March 2020, 09:46
hi to all, I've centos7.5 and Qt 5.7 in VM. I am trying to get child (lineEdit) from parent. I tried like this :-
void dialogAddNewRecord::insert_intoDB(QString *name, qint32 *stock, qint32 *rate, qint32 *number)
{
logindlg = new dialogLogin(this);
QLineEdit *uname_l = logindlg->findChild<QLineEdit*>("lineEditUserNameLoginForm");
QString uname = uname_l->text().trimmed();
qDebug() << "uname = " << uname;
qDebug() << uname_l;
}
this shows following output:-
uname = ""
QLineEdit(0x1c323e0, name="lineEditUserNameLoginForm")
how to get child lineEdit in form.
void dialogAddNewRecord::insert_intoDB(QString *name, qint32 *stock, qint32 *rate, qint32 *number)
{
logindlg = new dialogLogin(this);
QLineEdit *uname_l = logindlg->findChild<QLineEdit*>("lineEditUserNameLoginForm");
QString uname = uname_l->text().trimmed();
qDebug() << "uname = " << uname;
qDebug() << uname_l;
}
this shows following output:-
uname = ""
QLineEdit(0x1c323e0, name="lineEditUserNameLoginForm")
how to get child lineEdit in form.