Use QFactoryLoader::instance(int) instead if deprecated
QFactoryLoader::instance(key).
Change-Id: I61d087e7e03d472f69427e53f5f194856eb5bffe
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
#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) {