Recent code in font support started to use the platformNativeInterface()
return value without checking for null. Most platform plugins, with the
notable exception of linuxfb and the minimal ones, provide an object.
Start providing a dummy object from linuxfb too. This is more sensible
then adding null checks everywhere.
This will prevent crashing with linuxfb on startup.
Task-number: QTBUG-44414
Change-Id: I48912132e1f8ad52e2a94c3d765dacc7b16f309a
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
m_inputContext = QPlatformInputContextFactory::create();
+ m_nativeInterface.reset(new QPlatformNativeInterface);
+
m_vtHandler.reset(new QFbVtHandler);
}
return m_services.data();
}
+QPlatformNativeInterface *QLinuxFbIntegration::nativeInterface() const
+{
+ return m_nativeInterface.data();
+}
+
QT_END_NAMESPACE
#define QLINUXFBINTEGRATION_H
#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformnativeinterface.h>
QT_BEGIN_NAMESPACE
QPlatformServices *services() const Q_DECL_OVERRIDE;
QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE { return m_inputContext; }
+ QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE;
+
QList<QPlatformScreen *> screens() const;
private:
QScopedPointer<QPlatformFontDatabase> m_fontDb;
QScopedPointer<QPlatformServices> m_services;
QScopedPointer<QFbVtHandler> m_vtHandler;
+ QScopedPointer<QPlatformNativeInterface> m_nativeInterface;
};
QT_END_NAMESPACE