Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.12.1
-
None
-
Ubuntu 16.04.5 LTS 64-Bit" / ".../Qt5.12.1/5.12.1/gcc_64/
Description
From the documentation: "QTemporaryFile is used to create unique temporary files safely. The file itself is created by calling open()."
Being on "Ubuntu 16.04.5 LTS 64-Bit" with ".../Qt5.12.1/5.12.1/gcc_64/" "QTemporaryFile->open()" does not open the file ==> "QTemporaryFile->exists() == false".
Placing "(void) QTemporaryFile->fileName()" right under "QTemporaryFile->open()", triggers the opening of the file ==> "QTemporaryFile->exists() == true".
Identical source code without the workaround: "(void) QTemporaryFile->fileName()" works nicely on e.g. Windows7 and the latest OSX.
The last Qt version without the above behavior is Qt5.12.0.
Btw...: Same behavior in case the "QTemporaryFile" is not a pointer...
Extracted source code:
class webGate: public QNetworkAccessManager
{ Q_OBJECT public: webGate(QObject * parent = 0); ~webGate(); // ... private: QTemporaryFile *currentQTemporaryFile; };
webGate::webGate(QObject * parent) :
QNetworkAccessManager(parent)
void webGate::resultExtraction() {
// ...
if (currentQTemporaryFile->exists())
else {
if (currentQTemporaryFile->open()) {
#ifdef _linux_
if (!currentQTemporaryFile->exists())
else
{ qDebug().noquote().nospace() << __FILE__ << ":" << QString::number(__LINE__) << "\tOPENED \"QTemporaryFile\" WITHOUT \"EXISTENCE CHECK WORKAROUND\" ON LINUX...!\n"; }#endif
#if defined(_APPLE_) || defined(_WIN32)
if (!currentQTemporaryFile->exists())
#endif
} else
// ...
}
// ...
}
Attachments
Issue Links
- relates to
-
QTBUG-80157 QTemporaryFile: file not being created in Qt 5.11
-
- Closed
-