[Qt-interest] Unable to display QErrorMessage in modal dialog

Stephen Collyer scollyer at netspinner.co.uk
Thu Jun 11 14:44:30 CEST 2009


I have the following code which is called after an OK button is
clicked, in a modal dialog:

void InstallAgentSSLCertDlg::check_passphrase_data()
{
    QString pp_str  = passphrase->text();
    QString cpp_str = confirm_passphrase->text();

    if (! pp_str.isEmpty() || ! cpp_str.isEmpty() &&
        (pp_str != cpp_str))
    {
        QErrorMessage error;
        error.showMessage(tr("The passphrase and confirmation differ"));
    }
    else
    {
        accept();
    }
}

I never see the QErrorMessage if the true branch of the if
is taken. Can anyone tell me why this doesn't work ?

-- 
Stephen Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090611/3ffa3921/attachment.html 


More information about the Qt-interest-old mailing list