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.