fix(login): 验证码图原尺寸清晰显示(去放大缩放,避免糊导致看错字符)

This commit is contained in:
gaozheng 2026-06-25 11:18:44 +08:00
parent 4f205528ad
commit 2e4e4b24e4
1 changed files with 3 additions and 4 deletions

View File

@ -250,10 +250,9 @@ void LoginWindow::refreshCaptcha()
pix.loadFromData(QByteArray::fromBase64(b64));
}
if (pix.isNull() && !cap.code.isEmpty()) pix = renderCaptchaPixmap(cap.code);
captchaLabel_->setPixmap(
pix.isNull() ? pix
: pix.scaled(captchaLabel_->size(), Qt::KeepAspectRatio,
Qt::SmoothTransformation));
// 原尺寸显示(后端图约 88x40不再放大缩放——放大会糊导致看错验证码字符。
captchaLabel_->setScaledContents(false);
captchaLabel_->setPixmap(pix);
refreshBtn_->setEnabled(true);
});
connect(l, &geopro::net::CaptchaLoad::failed, this, [this, l](const QString& msg) {