diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-31 12:48:24 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-31 20:31:47 +0000 |
commit | 2ea853ba28e359fba7f98ba1286bc5c89a48105a (patch) | |
tree | 1f4118b793162529f9f725437b5fa0da60dc9394 /src/designer/src/lib/shared/qtresourceeditordialog.cpp | |
parent | 7e64a97986537fab1105385be8ce70f174ca5118 (diff) | |
download | qttools-2ea853ba28e359fba7f98ba1286bc5c89a48105a.tar.gz |
Qt Designer: Fix clang-tidy warnings about Qt usage
- Use multi-arg form of QString::arg()
- Fix static method calls
- Prefer QFileInfo::exists()
- Use isEmpty() for containers instead of checking size()
- Use QOverload
Change-Id: I31e92f77d0fa377932c1369afe2503abc8ecceac
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'src/designer/src/lib/shared/qtresourceeditordialog.cpp')
-rw-r--r-- | src/designer/src/lib/shared/qtresourceeditordialog.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/designer/src/lib/shared/qtresourceeditordialog.cpp b/src/designer/src/lib/shared/qtresourceeditordialog.cpp index 960313f49..05338c063 100644 --- a/src/designer/src/lib/shared/qtresourceeditordialog.cpp +++ b/src/designer/src/lib/shared/qtresourceeditordialog.cpp @@ -1863,7 +1863,10 @@ bool QtResourceEditorDialogPrivate::loadQrcFile(const QString &path, QtQrcFileDa QDomDocument doc; int errLine, errCol; if (!doc.setContent(dataArray, errorMessage, &errLine, &errCol)) { - *errorMessage = QCoreApplication::translate("QtResourceEditorDialog", "A parse error occurred at line %1, column %2 of %3:\n%4").arg(errLine).arg(errCol).arg(path).arg(*errorMessage); + *errorMessage = + QCoreApplication::translate("QtResourceEditorDialog", + "A parse error occurred at line %1, column %2 of %3:\n%4") + .arg(errLine).arg(errCol).arg(path, *errorMessage); return false; } @@ -1875,8 +1878,12 @@ bool QtResourceEditorDialogPrivate::saveQrcFile(const QtQrcFileData &qrcFileData QFile file(qrcFileData.qrcPath); while (!file.open(QIODevice::WriteOnly)) { QMessageBox msgBox(QMessageBox::Warning, - QCoreApplication::translate("QtResourceEditorDialog", "Save Resource File"), - QCoreApplication::translate("QtResourceEditorDialog", "Could not write %1: %2").arg(qrcFileData.qrcPath).arg(file.errorString()), + QCoreApplication::translate("QtResourceEditorDialog", + "Save Resource File"), + QCoreApplication::translate("QtResourceEditorDialog", + "Could not write %1: %2") + .arg(qrcFileData.qrcPath, + file.errorString()), QMessageBox::Cancel|QMessageBox::Ignore|QMessageBox::Retry); msgBox.setEscapeButton(QMessageBox::Cancel); msgBox.setDefaultButton(QMessageBox::Ignore); |