aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLuca Di Sera <luca.disera@qt.io>2021-10-20 16:06:47 +0200
committerLuca Di Sera <luca.disera@qt.io>2021-10-22 07:36:35 +0000
commit325938018be24fa54b2d06d9e16b040a925580f3 (patch)
treeeb4ef0f8f5f6bbcca192bde809dd8794f4cb164b /examples
parent2a660f7c930633ed94f08addf43259db864e07e2 (diff)
Remove deprecated usage of QQmlFileSelector::get in texteditor example
The text editor example adds a "touch" file selector to the qml engine that is used for the application such as to be able to provide an interface for touch based devices. The extra selectors were added by retrieving the engine's file selector trough QQmlFileSelector::get, which was deprecated in Qt 6.0, see commit 75563fa761b94e049de0a29e91591610b0d15745. This resulted in a deprecation warning when the example was built. To avoid the warning and the use of deprecated methods in examples, the example was modified to use the suggested replacement, `QQmlApplicationEngine::setExtraFileSelectors`. A line suggesting the use of the deprecated method was removed from `QQmlFileSelector`'s documentaton page. Fixes: QTBUG-97462 Pick-to: 6.2 Change-Id: I6ee0306647fe16e75c2cd72f3b37be6c7c5f9261 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/quickcontrols2/texteditor/texteditor.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/quickcontrols2/texteditor/texteditor.cpp b/examples/quickcontrols2/texteditor/texteditor.cpp
index 9b882dc803..72148c72ea 100644
--- a/examples/quickcontrols2/texteditor/texteditor.cpp
+++ b/examples/quickcontrols2/texteditor/texteditor.cpp
@@ -57,7 +57,6 @@
#include <QDebug>
#include <QQmlApplicationEngine>
#include <QQmlContext>
-#include <QQmlFileSelector>
#include <QQuickStyle>
#include "documenthandler.h"
@@ -87,7 +86,7 @@ int main(int argc, char *argv[])
#endif
QQmlApplicationEngine engine;
- QQmlFileSelector::get(&engine)->setExtraSelectors(selectors);
+ engine.setExtraFileSelectors(selectors);
engine.load(QUrl("qrc:/qml/texteditor.qml"));
if (engine.rootObjects().isEmpty())