Why shouldn't it be fast? You only check whether a file exists or not. What QTemporaryFile is doing: it creates a unique file name and ensures nobody else creates one with the same name in the same directory. This, for sure, involves some OS calls to make the creation of a temp file an atomic operation. Else several processes could create and use a temp file with same file name.
I have quickly gone through existing bugs reported for QTemporaryFile and nothing related found. So I have created new bug: https://bugreports.qt.io/browse/QTBUG-46156. IMO its better to have a few duplicates, that not reported at all :)
BTW, the resize(0) works fine.
Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.