summaryrefslogtreecommitdiffstats
path: root/src/designer
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-04-17 16:33:31 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-04-18 06:28:52 +0000
commit4e356cb519442bcb5c3c1bf690094e5edcf6676d (patch)
treef280b7bc7fd4e44118d4d0a9c6d2505c86fa9c27 /src/designer
parent14126f6be116e27f23d965c534ccb9a748282e66 (diff)
Qt Designer: Improve error messages on form creation failures
Add QTemporaryFile::errorString(). Task-number: QTBUG-67758 Change-Id: I611e0f0daa6a772553dec4b230266da566b1a953 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'src/designer')
-rw-r--r--src/designer/src/designer/newform.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/designer/src/designer/newform.cpp b/src/designer/src/designer/newform.cpp
index 0b937608c..09f3909cb 100644
--- a/src/designer/src/designer/newform.cpp
+++ b/src/designer/src/designer/newform.cpp
@@ -188,13 +188,15 @@ bool NewForm::openTemplate(QString *ptrToErrorMessage)
tempFormFile.setAutoRemove(true);
if (!tempFormFile.open()) {
- *ptrToErrorMessage = tr("A temporary form file could not be created in %1.").arg(QDir::tempPath());
+ *ptrToErrorMessage = tr("A temporary form file could not be created in %1: %2")
+ .arg(QDir::toNativeSeparators(QDir::tempPath()), tempFormFile.errorString());
return false;
}
const QString tempFormFileName = tempFormFile.fileName();
tempFormFile.write(contents.toUtf8());
if (!tempFormFile.flush()) {
- *ptrToErrorMessage = tr("The temporary form file %1 could not be written.").arg(tempFormFileName);
+ *ptrToErrorMessage = tr("The temporary form file %1 could not be written: %2")
+ .arg(QDir::toNativeSeparators(tempFormFileName), tempFormFile.errorString());
return false;
}
tempFormFile.close();