Details
Description
The reason is that QPdfDocument::load() creates a QFile each time. When it detects that it needs a password, it has to try again after the password is provided; at that time, QFile::open() fails, probably because Windows doesn't allow opening a file that's already open. So we have to be more careful about closing it and disposing the QFile if we're going to re-open it later, or else reuse the existing QFile instance perhaps.
Found by investigating test failures in https://codereview.qt-project.org/c/qt/qtwebengine/+/399780
Attachments
For Gerrit Dashboard: QTBUG-106072 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
429632,3 | Blacklist tst_MultiPageView::password on Windows | dev | qt/qtwebengine | Status: MERGED | +2 | 0 |
429633,2 | WIP try to fix tst_MultiPageView::password on Windows | dev | qt/qtwebengine | Status: ABANDONED | -2 | 0 |
429937,2 | Blacklist tst_MultiPageView::password on Windows | 6.4 | qt/qtwebengine | Status: MERGED | +2 | 0 |
461254,5 | Blacklist mulipageview tests on android | dev | qt/qtwebengine | Status: MERGED | +2 | 0 |
462668,3 | Fix resource file name for quick pdf | dev | qt/qtwebengine | Status: ABANDONED | 0 | 0 |
462972,7 | Fix not working password test for QPdfQuick | dev | qt/qtwebengine | Status: MERGED | +2 | 0 |
464041,3 | Fix not working password test for QPdfQuick | 6.5 | qt/qtwebengine | Status: MERGED | +2 | 0 |
464042,3 | Fix not working password test for QPdfQuick | 6.5.0 | qt/qtwebengine | Status: MERGED | +2 | 0 |
464043,3 | Fix not working password test for QPdfQuick | 6.4.3 | qt/qtwebengine | Status: MERGED | +2 | 0 |
466891,2 | Blacklist mulipageview tests on android | 6.5 | qt/qtwebengine | Status: MERGED | +2 | 0 |