Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed & robustified image tooltips (issue #593)
Last time I touched this code, I went in looking for a specific problem, and came out with a fix specific to that issue. That fix was not wrong, yet it hardly covered all the problems present in the code once one took into account issues like: - local vs remote resources, - relative vs absolute paths, - different operating systems behaving differently, and - Qt being uniquely buggy on different platforms. The major part of it was fixed by using QUrl.fromUserInput(), which does the exact kind of auto-detection for the nature of the resource that we were in need of. The rest of the issues were fixed by creating a number of test cases and fixing problems as they popped up. Testing was done in Windows & Ubunty against the above-mentioned test cases, which can be found in PR #629. Regarding ImageTooltip.supportedSchemes When QUrl.fromUserInput() misidentifies the scheme on Linux, it causes all resemblance between the original request and the reply.request() in the finished() signal to be lost, which results in this item getting stuck in the ImageTooltip processing pipeline. Limiting the supported schemes to the ones most commonly encountered ('file', 'http', 'https' and the schema-less local paths) is the only reliable method I have found to work around this particular bug in Qt.
- Loading branch information