Provide a native interface object from linuxfb

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>
This commit is contained in:
Laszlo Agocs 2015-02-11 13:32:34 +01:00 committed by Jani Heikkinen
parent d6ce94ae63
commit c66f2433b1
2 changed files with 11 additions and 0 deletions

View File

@ -69,6 +69,8 @@ void QLinuxFbIntegration::initialize()
m_inputContext = QPlatformInputContextFactory::create();
m_nativeInterface.reset(new QPlatformNativeInterface);
m_vtHandler.reset(new QFbVtHandler);
}
@ -113,4 +115,9 @@ QPlatformServices *QLinuxFbIntegration::services() const
return m_services.data();
}
QPlatformNativeInterface *QLinuxFbIntegration::nativeInterface() const
{
return m_nativeInterface.data();
}
QT_END_NAMESPACE

View File

@ -35,6 +35,7 @@
#define QLINUXFBINTEGRATION_H
#include <qpa/qplatformintegration.h>
#include <qpa/qplatformnativeinterface.h>
QT_BEGIN_NAMESPACE
@ -60,6 +61,8 @@ public:
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:
@ -68,6 +71,7 @@ private:
QScopedPointer<QPlatformFontDatabase> m_fontDb;
QScopedPointer<QPlatformServices> m_services;
QScopedPointer<QFbVtHandler> m_vtHandler;
QScopedPointer<QPlatformNativeInterface> m_nativeInterface;
};
QT_END_NAMESPACE