diff --git a/src/libs/vlayout/testpath.h b/src/libs/vlayout/testpath.h index 5d5d09855..b3e92c01b 100644 --- a/src/libs/vlayout/testpath.h +++ b/src/libs/vlayout/testpath.h @@ -59,6 +59,16 @@ void DumpVector(const QVector &points, const QString &templateName=QString()) if (temp.open()) { +#if defined(Q_OS_LINUX) + #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) +// On Linux, QTemporaryFile will attempt to create unnamed temporary +// files. If that succeeds, open() will return true but exists() will be +// false. If you call fileName() or any function that calls it, +// QTemporaryFile will give the file a name, so most applications will +// not see a difference. + temp.fileName(); // call to create a file on disk + #endif +#endif QJsonObject vectorObject; VectorToJson(points, vectorObject); QJsonDocument vector(vectorObject); diff --git a/src/libs/vpatterndb/testpassmark.cpp b/src/libs/vpatterndb/testpassmark.cpp index 0a7d7d189..b43597bbc 100644 --- a/src/libs/vpatterndb/testpassmark.cpp +++ b/src/libs/vpatterndb/testpassmark.cpp @@ -67,6 +67,16 @@ void DumpPassmarkData(const VPiecePassmarkData &data, const QString &templateNam if (temp.open()) { +#if defined(Q_OS_LINUX) + #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) +// On Linux, QTemporaryFile will attempt to create unnamed temporary +// files. If that succeeds, open() will return true but exists() will be +// false. If you call fileName() or any function that calls it, +// QTemporaryFile will give the file a name, so most applications will +// not see a difference. + temp.fileName(); // call to create a file on disk + #endif +#endif QJsonObject dataObject { {"data", data.toJson()}, @@ -92,6 +102,16 @@ void DumpPassmarkShape(const QVector &shape, const QString &templateName if (temp.open()) { +#if defined(Q_OS_LINUX) + #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) +// On Linux, QTemporaryFile will attempt to create unnamed temporary +// files. If that succeeds, open() will return true but exists() will be +// false. If you call fileName() or any function that calls it, +// QTemporaryFile will give the file a name, so most applications will +// not see a difference. + temp.fileName(); // call to create a file on disk + #endif +#endif QJsonObject shapeObject { {"shape", PassmarkShapeToJson(shape)}, diff --git a/src/libs/vpatterndb/vpiece.cpp b/src/libs/vpatterndb/vpiece.cpp index 3aa2e566b..959cca32f 100644 --- a/src/libs/vpatterndb/vpiece.cpp +++ b/src/libs/vpatterndb/vpiece.cpp @@ -1178,6 +1178,16 @@ void VPiece::DumpPiece(const VPiece &piece, const VContainer *data) temp.setAutoRemove(false); // Remove dump manually if (temp.open()) { +#if defined(Q_OS_LINUX) + #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) +// On Linux, QTemporaryFile will attempt to create unnamed temporary +// files. If that succeeds, open() will return true but exists() will be +// false. If you call fileName() or any function that calls it, +// QTemporaryFile will give the file a name, so most applications will +// not see a difference. + temp.fileName(); // call to create a file on disk + #endif +#endif QJsonObject testCase { {"bd", piece.DBToJson(data)},