我是 C++ 场景的新手,所以我想知道如何验证两个字段都输入了一些文本,这是当前代码,它只验证一个字段
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;
}
}