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

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -