Proper use of QString::arg

This commit is contained in:
Luis Ángel San Martín 2021-09-30 22:08:03 +02:00
parent 3291300d51
commit 0a2f7bd2af
2 changed files with 3 additions and 3 deletions

View File

@ -353,7 +353,7 @@ void TranslationLoader::run()
connect(&manager, &QNetworkAccessManager::finished, &q, &QEventLoop::quit); connect(&manager, &QNetworkAccessManager::finished, &q, &QEventLoop::quit);
QString url = "http://api.microsofttranslator.com/V2/Ajax.svc/Translate?appid=%1&from=%2&to=%3&text=%4&contentType=text/plain"; QString url = "http://api.microsofttranslator.com/V2/Ajax.svc/Translate?appid=%1&from=%2&to=%3&text=%4&contentType=text/plain";
url = url.arg(APPID).arg(from).arg(to).arg(text); url = url.arg(APPID, from, to, text);
QNetworkReply *reply = manager.get(QNetworkRequest(QUrl(url))); QNetworkReply *reply = manager.get(QNetworkRequest(QUrl(url)));
@ -396,7 +396,7 @@ void TextToSpeachLoader::run()
connect(&manager, &QNetworkAccessManager::finished, &q, &QEventLoop::quit); connect(&manager, &QNetworkAccessManager::finished, &q, &QEventLoop::quit);
QString url = "http://api.microsofttranslator.com/V2/Ajax.svc/Speak?appid=%1&language=%2&text=%3&contentType=text/plain"; QString url = "http://api.microsofttranslator.com/V2/Ajax.svc/Speak?appid=%1&language=%2&text=%3&contentType=text/plain";
url = url.arg(APPID).arg(language).arg(text); url = url.arg(APPID, language, text);
QNetworkReply *reply = manager.get(QNetworkRequest(QUrl(url))); QNetworkReply *reply = manager.get(QNetworkRequest(QUrl(url)));

View File

@ -56,7 +56,7 @@ void HelpAboutDialog::loadAboutInformation(const QString &path)
buildNumber = BUILD_NUMBER; buildNumber = BUILD_NUMBER;
#endif #endif
aboutText->setHtml(fileToString(path).arg(VERSION).arg(buildNumber)); aboutText->setHtml(fileToString(path).arg(VERSION, buildNumber));
aboutText->moveCursor(QTextCursor::Start); aboutText->moveCursor(QTextCursor::Start);
} }