QDialog exec returning Rejected always -
i have qdialog box accepts password , has ok button. when closing dialog box on "x", function should called. function being called if clicked on ok button. qdialog exec function returning rejected. code:
if (password->exec() == qdialog::accepted) { qstring passwordtext = passwordentry->text(); } else { sshdialogboxclosed(); } delete password;
in case sshdialogboxclosed() function being called. please me resolve issue. in advance
you need connect "ok" button "accept" slot , "cancel" button "reject" slot.
qdialog::connect(acceptbutton,signal(clicked(bool)),this,slot(accept())); qdialog::connect(rejectbutton,signal(clicked(bool)),this,slot(reject()));
Comments
Post a Comment