The program have a slot named loginBtnSlot in LoginDialog . The console output has no error about the signal-slot-connection problems.
When I use the statement:
@
QMetaObject::Connection conn = connect( mpLoginBtn, SIGNAL(clicked()), this, SLOT(loginBtnSlot()) );
if( conn ) {
qDebug() << "conn is ok.";
}
@
It can output "conn is ok.".
I add these statements below afterwards, then found that everything was all right.
@
QPushButton *pCancelBtn = new QPushButton( tr("Cancel"), this );
connect( pCancelBtn, SIGNAL(clicked()), this, SLOT(reject()) );
@