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:
parent
d6ce94ae63
commit
c66f2433b1
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user