diff options
-rw-r--r-- | src/quick/scenegraph/qsgcontextplugin.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgcontextplugin.cpp b/src/quick/scenegraph/qsgcontextplugin.cpp index bd1c4cece8..dd5ad490b9 100644 --- a/src/quick/scenegraph/qsgcontextplugin.cpp +++ b/src/quick/scenegraph/qsgcontextplugin.cpp @@ -99,7 +99,9 @@ QSGAdaptionPluginData *contextFactory() #if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) if (!device.isEmpty()) { - plugin->factory = qobject_cast<QSGContextFactoryInterface*>(loader()->instance(device)); + const int index = loader()->indexOf(device); + if (index != -1) + plugin->factory = qobject_cast<QSGContextFactoryInterface*>(loader()->instance(index)); plugin->deviceName = device; #ifndef QT_NO_DEBUG if (!plugin->factory) { |