diff options
author | Ulf Hermann <[email protected]> | 2023-01-10 14:40:11 +0100 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2023-01-11 10:14:00 +0100 |
commit | 34331019c281388d91dfc4aa38e76f16d397a17f (patch) | |
tree | c4b04d9c66ce0f6f485e8d9ffe67dec3a26c6f12 | |
parent | e9e315da06bc067b0dcb160cd88492bfe89b08c0 (diff) |
TextEditor example: Avoid deprecation warning
What we want there is intercept the URL through the QML engine. No need
to dig out the specific QQmlFileSelector for that.
Pick-to: 6.5
Fixes: QTBUG-102777
Change-Id: I5ca59316a2434013f91afdf92d3e397ea2711128
Reviewed-by: Sami Shalayel <[email protected]>
-rw-r--r-- | examples/quickcontrols/texteditor/documenthandler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/quickcontrols/texteditor/documenthandler.cpp b/examples/quickcontrols/texteditor/documenthandler.cpp index 9571aa03ba..f6ed6aef84 100644 --- a/examples/quickcontrols/texteditor/documenthandler.cpp +++ b/examples/quickcontrols/texteditor/documenthandler.cpp @@ -149,7 +149,7 @@ void DocumentHandler::load(const QUrl &fileUrl) return; } - const QUrl path = QQmlFileSelector::get(engine)->selector()->select(fileUrl); + const QUrl path = engine->interceptUrl(fileUrl, QQmlAbstractUrlInterceptor::UrlString); const QString fileName = QQmlFile::urlToLocalFileOrQrc(path); if (QFile::exists(fileName)) { QMimeType mime = QMimeDatabase().mimeTypeForFile(fileName); |