Check if two consts are empty
I'm kind of new to the C++ scene so I'm wondering how I'd verify both
fields have some text entered, here's the current code which is only
verifying one field
void App::requestLogin(const QString &email, const QString &password) {
if (m_active)
return;
//how can I do both password and email here????
const QStringList list = email.split(QRegExp("\\s+"),
QString::SkipEmptyParts);
if (list.isEmpty()) {
m_errorMessage = "please complete both fields";
m_error = true;
emit statusChanged();
return;
}
}
No comments:
Post a Comment