From 67ee1cd27b5e951e782e49edf382e8e7d8ee431f Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Fri, 5 Jul 2013 14:31:06 -0700 Subject: Apply file selectors to QQmlApplicationEngine apps You can also manually apply them to a QQmlEngine using setUrlInterceptor(new QQmlFileSelector(parent)), or using your own QQmlAbstractUrlInterceptor subclass. Change-Id: I0c0ff8b080c138686b3c03e0bc3b9f25bcd11a85 Reviewed-by: Lars Knoll --- examples/quick/shared/shared.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'examples/quick/shared/shared.h') diff --git a/examples/quick/shared/shared.h b/examples/quick/shared/shared.h index 648b2944b7..5cf1333c02 100644 --- a/examples/quick/shared/shared.h +++ b/examples/quick/shared/shared.h @@ -40,7 +40,8 @@ #include #include #include -#include +#include +#include //Not using QQmlApplicationEngine because many examples don't have a Window{} #define DECLARATIVE_EXAMPLE_MAIN(NAME) int main(int argc, char* argv[]) \ {\ QGuiApplication app(argc,argv);\ @@ -49,6 +50,7 @@ app.setApplicationName(QFileInfo(app.applicationFilePath()).baseName());\ QQuickView view;\ view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));\ + view.engine()->setUrlInterceptor(new QQmlFileSelector(&view));\ view.setSource(QUrl("qrc:///" #NAME ".qml")); \ view.setResizeMode(QQuickView::SizeRootObjectToView);\ if (QGuiApplication::platformName() == QLatin1String("qnx") || \ -- cgit v1.2.3